Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "2.1.10"
kotlin("jvm") version "1.9.20"
id("com.vanniktech.maven.publish") version "0.28.0"
}

Expand All @@ -11,6 +11,6 @@ repositories {

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/openlayer.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<JavaCompile>().configureEach {
Expand Down
25 changes: 13 additions & 12 deletions buildSrc/src/main/kotlin/openlayer.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("openlayer.java")
Expand All @@ -11,25 +11,26 @@ kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

configure<SpotlessExtension> {
kotlin {
ktfmt().kotlinlangStyle()
toggleOffOn()
}
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs = listOf(
"-Xjvm-default=all",
"-Xjdk-release=1.8",
// Suppress deprecation warnings because we may still reference and test deprecated members.
"-Xsuppress-warning=DEPRECATION"
// TODO: Replace with `-Xsuppress-warning=DEPRECATION` once we use Kotlin compiler 2.1.0+.
"-nowarn",
)
jvmTarget.set(JvmTarget.JVM_1_8)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
apiVersion.set(KotlinVersion.KOTLIN_1_8)
coreLibrariesVersion = "1.8.0"
}
}

configure<SpotlessExtension> {
kotlin {
ktfmt().kotlinlangStyle()
toggleOffOn()
}
}

Expand Down
10 changes: 7 additions & 3 deletions openlayer-java-example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
plugins {
id("openlayer.kotlin")
id("java")
application
}

repositories {
mavenCentral()
}

dependencies {
implementation(project(":openlayer-java"))
}

tasks.withType<JavaCompile>().configureEach {
java {
// Allow using more modern APIs, like `List.of` and `Map.of`, in examples.
options.release.set(9)
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
}

application {
Expand Down