2020-06-11 00:23:41 +02:00
|
|
|
import org.gradle.internal.jvm.Jvm
|
|
|
|
|
2014-11-09 18:02:29 +01:00
|
|
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
2018-06-10 17:27:18 +02:00
|
|
|
google()
|
2018-06-08 05:42:25 +02:00
|
|
|
jcenter()
|
2014-11-09 18:02:29 +01:00
|
|
|
}
|
|
|
|
dependencies {
|
2020-06-03 02:58:32 +02:00
|
|
|
classpath 'com.android.tools.build:gradle:4.0.0'
|
2014-11-09 18:02:29 +01:00
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
|
|
// in the individual module build.gradle files
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-11 23:45:45 +01:00
|
|
|
ext {
|
2019-01-26 21:41:41 +01:00
|
|
|
|
2020-06-11 00:23:41 +02:00
|
|
|
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
|
2019-11-18 16:21:48 +01:00
|
|
|
preDexEnabled = "true" == System.getProperty("pre-dex", "true")
|
2018-11-24 21:11:48 +01:00
|
|
|
|
2019-11-04 04:42:37 +01:00
|
|
|
// 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
|
2018-11-24 21:11:48 +01:00
|
|
|
gradleTestMaxParallelForks = 1
|
|
|
|
if (!travisBuild) {
|
|
|
|
gradleTestMaxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
|
|
|
|
}
|
2016-10-23 10:55:19 +02:00
|
|
|
}
|
2018-11-24 21:11:48 +01:00
|
|
|
|