-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
62 lines (50 loc) · 1.65 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
60
61
import org.gradle.jvm.tasks.Jar
import com.gradle.publish.PublishTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
group = "tanvd.kosogor"
plugins {
id("tanvd.kosogor") version "1.0.22" apply false
kotlin("jvm") version "2.1.0" apply true
}
repositories {
mavenCentral()
}
// kotlin plugin exposes Jar tasks but root project does not have any sources
tasks.withType<Jar>().configureEach {
enabled = false
}
subprojects {
apply(plugin = "kotlin")
apply(plugin = "tanvd.kosogor")
apply(plugin = "com.gradle.plugin-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of("17"))
}
}
kotlin {
jvmToolchain(17)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)
// https://jakewharton.com/kotlins-jdk-release-compatibility-flag/
// https://youtrack.jetbrains.com/issue/KT-49746/Support-Xjdk-release-in-gradle-toolchain#focus=Comments-27-8935065.0-0
freeCompilerArgs.addAll("-Xjdk-release=17")
}
}
repositories {
mavenCentral()
gradlePluginPortal()
}
afterEvaluate {
if (version.toString().contains("SNAPSHOT")) {
tasks.withType(PublishTask::class) {
enabled = false
}
}
System.setProperty("gradle.publish.key", System.getenv("gradle_publish_key") ?: "")
System.setProperty("gradle.publish.secret", System.getenv("gradle_publish_secret") ?: "")
}
}