-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle.kts
51 lines (44 loc) · 1.96 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
import dev.drewhamilton.poko.build.setUpLocalSigning
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// Note: kotlin-jvm and kotlin-multiplatform plugins are added implicitly via build-support
alias(libs.plugins.kotlinx.binaryCompatibilityValidator) apply false
alias(libs.plugins.ksp) apply false
}
allprojects {
setUpLocalSigning()
repositories {
mavenCentral()
// KSP:
google()
val snapshotsRepository = rootProject.findProperty("snapshots_repository")
if (snapshotsRepository != null) {
logger.lifecycle("Adding <$snapshotsRepository> repository for ${this@allprojects}")
maven { url = uri(snapshotsRepository) }
}
val kotlinDevRepository = rootProject.findProperty("kotlin_dev_repository")
if (kotlinDevRepository != null) {
logger.lifecycle("Adding <$kotlinDevRepository> repository for ${this@allprojects}")
maven { url = uri(kotlinDevRepository) }
}
}
// The tests vary their own JVM targets among multiple targets. Do not overwrite them.
if (path !in setOf(":poko-tests")) {
val kotlinPluginHandler: AppliedPlugin.() -> Unit = {
val javaVersion = JavaVersion.VERSION_1_8
project.tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
project.tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(javaVersion.toString()))
freeCompilerArgs.add("-Xjdk-release=$javaVersion")
}
}
}
pluginManager.withPlugin("org.jetbrains.kotlin.jvm", kotlinPluginHandler)
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform", kotlinPluginHandler)
}
}