-
Notifications
You must be signed in to change notification settings - Fork 45
/
build.gradle.kts
59 lines (50 loc) · 1.21 KB
/
build.gradle.kts
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
allprojects {
repositories {
google()
jcenter()
}
}
buildscript {
repositories {
google()
jcenter()
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath(GradlePlugins.GRADLE)
classpath(GradlePlugins.KOTLIN)
classpath(MavenPublish.MAVEN_PUBLISH)
}
}
subprojects {
enableInlineClasses()
setJvmTarget()
setKotlinLangLevel()
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
fun Project.enableInlineClasses() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
val args = kotlinOptions.freeCompilerArgs
kotlinOptions.freeCompilerArgs = args + listOf("-XXLanguage:+InlineClasses")
}
}
}
fun Project.setJvmTarget() {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
}
}
}
fun Project.setKotlinLangLevel() {
tasks.withType<KotlinCompile> {
kotlinOptions {
languageVersion = "1.6"
}
}
}