gecko/mobile/android/gradle/build.gradle
Nick Alexander c893fc2223 No bug - Make project-wide default language level be Java 1.7 in IntelliJ. r=me
DONTBUILD NPOTB

Straight from http://stackoverflow.com/a/24751182 and the linked
IntelliJ tickets.
2015-08-21 16:16:16 -07:00

84 lines
2.3 KiB
Groovy

allprojects {
// Expose the per-object-directory configuration to all projects.
ext {
mozconfig = gradle.mozconfig
topsrcdir = gradle.mozconfig.topsrcdir
topobjdir = gradle.mozconfig.topobjdir
}
repositories {
jcenter()
}
}
buildDir "${topobjdir}/mobile/android/gradle/build"
buildscript {
repositories {
jcenter()
// 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'
}
}
dependencies {
// 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'
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3-SNAPSHOT') {
// Without these, we get errors linting.
exclude module: 'guava'
}
}
}
task generateCodeAndResources(type:Exec) {
workingDir "${topobjdir}"
commandLine mozconfig.substs.GMAKE
args '-C'
args "${topobjdir}/mobile/android/base"
args 'gradle-targets'
// 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()}")
}
}
}
afterEvaluate {
subprojects {
if (!hasProperty('android')) {
return
}
android.applicationVariants.all {
checkManifest.dependsOn rootProject.generateCodeAndResources
}
android.libraryVariants.all {
checkManifest.dependsOn rootProject.generateCodeAndResources
}
}
}
apply plugin: 'idea'
idea {
project {
languageLevel = '1.7'
}
}