0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Anki-Android/build.gradle

68 lines
3.4 KiB
Groovy
Raw Normal View History

import org.gradle.internal.jvm.Jvm
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
// Temporary, needed while investigating https://github.com/ankidroid/Anki-Android/issues/7558
maven {
url 'https://storage.googleapis.com/r8-releases/raw'
}
maven {
url "https://storage.googleapis.com/r8-releases/raw/master"
}
// End temporary #7558 work
}
dependencies {
// Temporary, for #7558 where AGP4.0.x works, 4.1.x fails, from https://issuetracker.google.com/issues/169584856
// Without workarounds we get 'com.android.tools.r8.CompilationFailedException: Compilation failed to complete'
// test case is to run `./gradlew assembleRelease` - if it gets to the point where it fails on keystore password, R8 already worked == success
//classpath 'com.android.tools:r8:25999632a8450072e0e39f2b28085ccb9766203f' // This is diagnostic. Should Assertion error. Works?
//classpath 'com.android.tools:r8:89ac4c72113fdb73b43159522c932a1665de96c9' // This is diagnostic. Expect Assertion failure. Works?
//classpath 'com.android.tools:r8:2.2.28' // Release version, should work. Works.
//classpath 'com.android.tools:r8:2.1.74' // Cherry-picked / backport release, should work, fails with NullPointerException.
//classpath 'com.android.tools:r8:2.1.80' // Current stable release matched to AGP4.1.1 I think. Should work, fails with NullPointerException.
classpath 'com.android.tools:r8:2.2.40' // Current stable release matched to AGP4.2 I think. Should work.
// End of Temporary #7558 work
classpath 'com.android.tools.build:gradle:4.1.1' // This includes R8, and future versions will allow removal of #7558 workarounds.
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "app.brant:amazonappstorepublisher:0.1.0"
}
}
2016-03-11 23:45:45 +01:00
ext {
jvmVersion = Jvm.current().javaVersion.majorVersion
if (jvmVersion != "8" && jvmVersion != "11" && jvmVersion != "14") {
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
println "ERROR: AnkiDroid builds with JVM LTS and current releases (currently major version 8, 11, or 14)."
println " Incompatible major version detected: '" + jvmVersion + "'"
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
System.exit(1)
}
2016-03-11 23:45:45 +01:00
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true" == System.getProperty("pre-dex", "true")
// allows for universal APKs to be generated
universalApkEnabled = "true" == System.getProperty("universal-apk", "false")
// Travis may report host CPU counts vs guest, but runs 2 cores everywhere
// everyone else gets 50% of cores to account for SMT which doesn't help this workload
gradleTestMaxParallelForks = 1
if (!travisBuild) {
gradleTestMaxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
2016-10-23 10:55:19 +02:00
}