-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
37 lines (34 loc) · 933 Bytes
/
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
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
}
subprojects {
afterEvaluate {
extensions.findByType<KotlinProjectExtension>()?.apply {
jvmToolchain(
libs.versions.toolchain
.get()
.toInt(),
)
}
}
}
fun execTask(taskName: String) {
var execute = "gradlew.bat"
if (!OperatingSystem.current().isWindows) {
execute = "gradlew"
}
exec {
executable = execute
args = listOf(taskName, "--scan")
}
}
tasks.register("publish") {
doLast { execTask(":plugin:publishToCentralPortal") }
}
tasks.register("format") {
doLast { execTask(":plugin:ktlintFormat") }
}