build.gradle
1.3 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
plugins {
id 'java-library'
id 'kotlin'
id 'kotlin-kapt'
}
java {
sourceCompatibility = java_version
targetCompatibility = java_version
}
// From Gradle 8 onwards, Kapt no longer automatically picks up jvmTarget
// from normal KotlinOptions. Must be manually set.
// JvmToolchain should not be used since it changes the actual JDK used.
tasks.withType(org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile).configureEach {
kotlinOptions {
jvmTarget = java_version
}
}
compileKotlin {
kotlinOptions {
jvmTarget = java_version
}
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// used for lint rules
compileOnly libs.lint.api
compileOnly libs.lint.checks
compileOnly libs.lint.tests
// Handle creating manifests for lint checker
compileOnly libs.auto.service.annotations
kapt libs.auto.service.compiler
// test lint
testImplementation libs.lint.lib
testImplementation libs.lint.tests
compileOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// test runners
testImplementation libs.junit
testImplementation libs.junitJupiterApi
testRuntimeOnly libs.junitJupiterEngine
}
test {
environment "LINT_TEST_KOTLINC", ""
}