forked from ankidroid/Anki-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
62 lines (52 loc) · 2.21 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import org.gradle.internal.jvm.Jvm
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
// The version for the Kotlin plugin and dependencies
ext.kotlin_version = '1.5.31'
ext.lint_version = '30.0.3'
repositories {
google()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "app.brant:amazonappstorepublisher:0.1.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.2.0"
}
}
repositories {
mavenCentral()
}
allprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
}
ext {
jvmVersion = Jvm.current().javaVersion.majorVersion
if (jvmVersion != "11" && jvmVersion != "14" && jvmVersion != "16") {
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
println "ERROR: AnkiDroid builds with JVM version 11, 14, or 16."
println " Incompatible major version detected: '" + jvmVersion + "'"
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
System.exit(1)
}
ciBuild = System.getenv("CI") == "true" // works for Travis CI or Github Actions
// 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")
// Virtualized Environment like CI may report host CPU counts vs guest, but runs 2 cores
// everyone else gets 50% of cores to account for SMT which doesn't help this workload
gradleTestMaxParallelForks = 1
if (!ciBuild) {
gradleTestMaxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}