gecko-dev/mobile/android/gradle/omnijar/build.gradle
Nick Alexander 711f72faeb Bug 1160357 - Share generateCodeAndResources across Gradle projects. r=me
This is just a clean-up: rather than having each subproject have a
generateCodeAndResources build action, we have a single action
(attached to the root project) which all subprojects depend on.
Gradle orders the task DAG accordingly, saving process invocations and
speeding up the build.

--HG--
extra : source : b44dc79fbddb1acc02da12e9926852e67d606584
extra : amend_source : b89249d8af2b7986ab1174f89c150ef8115c71cf
2015-03-31 17:46:48 -07:00

43 lines
1.1 KiB
Groovy

apply plugin: 'java'
/**
* This task runs when any input file is newer than the omnijar.
*/
task buildOmnijar(type:Exec) {
dependsOn rootProject.generateCodeAndResources
// Depend on all the Gecko resources.
inputs.sourceDir 'src/main/java/locales'
inputs.sourceDir 'src/main/java/chrome'
inputs.sourceDir 'src/main/java/components'
inputs.sourceDir 'src/main/java/modules'
inputs.sourceDir 'src/main/java/themes'
// Produce a single output file.
outputs.file "${topobjdir}/dist/fennec/assets/omni.ja"
workingDir "${topobjdir}"
commandLine mozconfig.substs.GMAKE
args '-C'
args "${topobjdir}/mobile/android/base"
args 'gradle-omnijar'
// Only show the output if something went wrong.
ignoreExitValue = true
standardOutput = new ByteArrayOutputStream()
errorOutput = standardOutput
doLast {
if (execResult.exitValue != 0) {
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
}
}
}
apply plugin: 'idea'
idea {
module {
}
}