aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-03-02 15:46:41 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2015-03-02 15:46:41 +0100
commitfab60f2ddb4917515570f7c60a1be22670cd836e (patch)
tree3e9ee62b569b605e42a3544f7a68dfe64db4672a /build.gradle
parent69865a6d574e2a81b6ba4fbd11254d90629c14aa (diff)
downloadopen-keychain-fab60f2ddb4917515570f7c60a1be22670cd836e.tar.gz
open-keychain-fab60f2ddb4917515570f7c60a1be22670cd836e.tar.bz2
open-keychain-fab60f2ddb4917515570f7c60a1be22670cd836e.zip
Gradle hack to always use same build tools in subprojects
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle31
1 files changed, 31 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index f8e6afc27..9b6363e93 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,3 +38,34 @@ project(':extern:spongycastle') {
test.enabled = false
}
}
+
+// Copied from https://gitlab.com/fdroid/fdroidclient/blob/master/build.gradle#L144
+subprojects {
+
+ // This is the hacky way which we force the subprojects to use the same build tools:
+ // http://stackoverflow.com/a/21032272
+ afterEvaluate {
+ if ( it.hasProperty( 'android' ) ) {
+ android {
+
+ // The android build task only lets you configure the buildToolsVersion once, so if
+ // we execute the closure below to configure our subprojects, it will fail when it
+ // hits the second subproject. Therefore, we will only do it once, and I guess the
+ // android plugin will re-use the existing value I set.
+ // https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/BaseExtension.groovy
+ try {
+ buildToolsVersion '21.1.2'
+ logger.info("Set buildToolsVersion to '21.1.2'")
+ } catch (GradleException e) {
+ logger.info("Tried to set the buildToolsVersion, however we were not allowed to: $e.message")
+ }
+
+ // don't abort build on lint errors
+ // http://stackoverflow.com/a/25149514
+ configure(android.lintOptions) {
+ abortOnError false
+ }
+ }
+ }
+ }
+} \ No newline at end of file