-
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
59 lines (48 loc) · 1.68 KB
/
build.gradle.kts
File metadata and controls
59 lines (48 loc) · 1.68 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
50
51
52
53
54
55
56
57
58
59
plugins {
kotlin("jvm") version libs.versions.kotlin apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.versions)
}
// Set the build directory to not /build to prevent accidental deletion through the clean action
// Can be deleted after the migration to Gradle is complete
layout.buildDirectory = file(".build")
val enableWebGPU = findProperty("enableWebGPU")?.toString()?.toBoolean() ?: false
val javaVersion = if (enableWebGPU) "25" else "17"
val kotlinJvmTarget = if (enableWebGPU) {
org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_25
} else {
org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
allprojects {
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(kotlinJvmTarget)
}
}
plugins.withType<JavaPlugin> {
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion.toInt()))
}
}
}
}
// Configure the dependencyUpdates task
tasks {
dependencyUpdates {
gradleReleaseChannel = "current"
val nonStableKeywords = listOf("alpha", "beta", "rc")
fun isNonStable(version: String) = nonStableKeywords.any {
version.lowercase().contains(it)
}
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
}