2014-12-22 19:49:04 -08:00
|
|
|
allprojects {
|
|
|
|
// Expose the per-object-directory configuration to all projects.
|
|
|
|
ext {
|
|
|
|
mozconfig = gradle.mozconfig
|
|
|
|
topsrcdir = gradle.mozconfig.topsrcdir
|
|
|
|
topobjdir = gradle.mozconfig.topobjdir
|
|
|
|
}
|
2015-05-24 19:51:22 -07:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
}
|
2014-11-10 13:47:30 -08:00
|
|
|
}
|
|
|
|
|
2014-12-22 19:49:04 -08:00
|
|
|
buildDir "${topobjdir}/mobile/android/gradle/build"
|
|
|
|
|
2014-11-10 13:47:30 -08:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
2015-06-04 12:09:23 -07:00
|
|
|
|
|
|
|
// For spoon-gradle-plugin SNAPSHOT release. This needs to go before
|
|
|
|
// the snapshots repository, otherwise we find a remote 1.0.3-SNAPSHOT
|
|
|
|
// that doesn't include nalexander's local changes.
|
|
|
|
maven {
|
|
|
|
url "file://${topsrcdir}/mobile/android/gradle/m2repo"
|
|
|
|
}
|
|
|
|
// For spoon SNAPSHOT releases.
|
|
|
|
maven {
|
|
|
|
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
|
|
|
}
|
2014-11-10 13:47:30 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2015-01-14 11:11:00 -08:00
|
|
|
// IntelliJ 14.0.2 wants 0.14.4; IntelliJ 14.0.3 and Android Studio want
|
|
|
|
// 1.0.0. There are major issues with the combination of 0.14.4, Gradle
|
|
|
|
// 2.2.1, and IntelliJ 14.0.2: see Bug 1120032.
|
|
|
|
classpath 'com.android.tools.build:gradle:1.0.0'
|
2015-06-04 12:09:23 -07:00
|
|
|
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3-SNAPSHOT') {
|
|
|
|
// Without these, we get errors linting.
|
|
|
|
exclude module: 'guava'
|
|
|
|
}
|
2014-11-10 13:47:30 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-31 17:46:48 -07:00
|
|
|
task generateCodeAndResources(type:Exec) {
|
|
|
|
workingDir "${topobjdir}"
|
2014-12-22 19:49:04 -08:00
|
|
|
|
2015-03-31 17:46:48 -07:00
|
|
|
commandLine mozconfig.substs.GMAKE
|
|
|
|
args '-C'
|
|
|
|
args "${topobjdir}/mobile/android/base"
|
|
|
|
args 'gradle-targets'
|
2015-01-27 21:41:14 -08:00
|
|
|
|
2015-03-31 17:46:48 -07:00
|
|
|
// 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()}")
|
2015-01-27 21:41:14 -08:00
|
|
|
}
|
2014-12-22 19:49:04 -08:00
|
|
|
}
|
|
|
|
}
|
2015-08-20 15:10:06 -07:00
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
subprojects {
|
|
|
|
if (!hasProperty('android')) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
android.applicationVariants.all {
|
|
|
|
checkManifest.dependsOn rootProject.generateCodeAndResources
|
|
|
|
}
|
|
|
|
android.libraryVariants.all {
|
|
|
|
checkManifest.dependsOn rootProject.generateCodeAndResources
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-08-21 16:16:16 -07:00
|
|
|
|
|
|
|
apply plugin: 'idea'
|
|
|
|
|
|
|
|
idea {
|
|
|
|
project {
|
|
|
|
languageLevel = '1.7'
|
|
|
|
}
|
|
|
|
}
|