Skip to content

Commit 9dc1230

Browse files
committed
Clean up kobweb-cli-compilation-settings
... moving repository management to the settings.gradle.kts file and also using the simpler "options.release" value for setting the JVM target.
1 parent 189e6ca commit 9dc1230

3 files changed

Lines changed: 34 additions & 24 deletions

File tree

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33

4-
repositories {
5-
mavenCentral()
6-
maven {
7-
// For kotter snapshots and Kobweb artifacts
8-
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
9-
mavenContent {
10-
includeGroup("com.varabyte.kotter")
11-
includeGroupByRegex("com\\.varabyte\\.kobwebx?")
12-
snapshotsOnly()
13-
}
14-
}
15-
}
16-
174
// Require Java 11 for a few APIs. A very important one is ProcessHandle, used for detecting if a
185
// server is running in a cross-platform way.
196
val jvmTarget = JvmTarget.JVM_11
207
tasks.withType<JavaCompile>().configureEach {
21-
sourceCompatibility = jvmTarget.target
22-
targetCompatibility = jvmTarget.target
8+
options.release.set(JvmTarget.JVM_11.target.toInt())
239
}
2410

2511
tasks.withType<KotlinCompile>().configureEach {
2612
compilerOptions.jvmTarget.set(jvmTarget)
13+
compilerOptions.freeCompilerArgs.add("-Xjdk-release=${JvmTarget.JVM_11.target}")
2714
}

kobweb/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ plugins {
1414
group = "com.varabyte.kobweb.cli"
1515
version = libs.versions.kobweb.cli.get()
1616

17-
repositories {
18-
// For Gradle Tooling API
19-
maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
20-
// TODO: Remove this repository once clikt-core module is published https://github.com/ajalt/clikt/issues/523
21-
maven {
22-
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
23-
}
24-
}
25-
2617
dependencies {
2718
implementation(kotlin("stdlib"))
2819
implementation(libs.clikt.core)

settings.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
1+
2+
3+
import org.gradle.kotlin.dsl.repositories
4+
15
pluginManagement {
26
repositories {
37
gradlePluginPortal()
48
}
59
includeBuild("gradle/build-logic")
610
}
711

12+
@Suppress("UnstableApiUsage")
13+
dependencyResolutionManagement {
14+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
15+
repositories {
16+
mavenCentral()
17+
18+
// Special Gradle repo for gradle tooling library
19+
exclusiveContent {
20+
forRepository {
21+
maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
22+
}
23+
filter {
24+
includeGroup("org.gradle")
25+
}
26+
}
27+
28+
maven {
29+
// For kotter snapshots and Kobweb artifacts
30+
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
31+
mavenContent {
32+
includeGroup("com.varabyte.kotter")
33+
includeGroupByRegex("com\\.varabyte\\.kobwebx?")
34+
snapshotsOnly()
35+
}
36+
}
37+
}
38+
}
39+
840
rootProject.name = "kobweb-cli"
941

1042
include(":kobweb")

0 commit comments

Comments
 (0)