forked from thunderbird/thunderbird-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththunderbird.library.android.gradle.kts
More file actions
87 lines (75 loc) · 2.67 KB
/
Copy paththunderbird.library.android.gradle.kts
File metadata and controls
87 lines (75 loc) · 2.67 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
plugins {
id("com.android.library")
id("net.thunderbird.gradle.plugin.quality.coverage")
id("net.thunderbird.gradle.plugin.quality.detekt")
id("net.thunderbird.gradle.plugin.quality.spotless")
}
android {
compileSdk = ThunderbirdProjectConfig.Android.sdkCompile
defaultConfig {
minSdk = ThunderbirdProjectConfig.Android.sdkMin
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility = ThunderbirdProjectConfig.Compiler.javaCompatibility
targetCompatibility = ThunderbirdProjectConfig.Compiler.javaCompatibility
}
buildFeatures {
buildConfig = false
}
lint {
warningsAsErrors = false
abortOnError = true
checkDependencies = true
lintConfig = project.file("${project.rootProject.projectDir}/config/lint/lint.xml")
checkReleaseBuilds = System.getenv("CI_CHECK_RELEASE_BUILDS")?.toBoolean() ?: true
}
packaging {
resources {
excludes += listOf(
"/META-INF/{AL2.0,LGPL2.1}",
"/META-INF/DEPENDENCIES",
"/META-INF/LICENSE",
"/META-INF/LICENSE.txt",
"/META-INF/NOTICE",
"/META-INF/NOTICE.txt",
"/META-INF/README",
"/META-INF/README.md",
"/META-INF/CHANGES",
"/LICENSE.txt",
)
}
}
/**
* Disables the C2 compiler for Robolectric tests.
*
* This is a workaround for a known issue where Robolectric tests can fail on JDK 17+
* with a "failed to compile" error. The issue is related to the Tiered Compilation in the JVM,
* specifically the C2 (server) compiler. Disabling C2 forces the JVM to use the C1 (client)
* compiler, which avoids the problem.
*
* The official workaround uses `-XX:+TieredCompilation -XX:TieredStopAtLevel=1`, but just
* `-XX:TieredStopAtLevel=3` seems to work. In case the flakiness still happens, we can
* use the workaround mentioned in the issue.
*
* See: https://github.com/robolectric/robolectric/issues/3202
*/
testOptions {
unitTests.all {
it.jvmArgs("-XX:TieredStopAtLevel=3")
}
}
}
kotlin {
compilerOptions {
jvmTarget.set(ThunderbirdProjectConfig.Compiler.jvmTarget)
}
}
dependencies {
implementation(platform(libs.kotlin.bom))
implementation(platform(libs.koin.bom))
implementation(libs.bundles.shared.jvm.main)
implementation(libs.bundles.shared.jvm.android)
testImplementation(libs.bundles.shared.jvm.test)
}