Skip to content

Commit 50aa0bf

Browse files
committed
fix: fixed build error
1 parent b9e45b9 commit 50aa0bf

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

build.gradle.kts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ tasks.named<Jar>("jar") {
169169
}
170170
}
171171

172+
java {
173+
// Use Java 21 for compilation
174+
toolchain {
175+
languageVersion.set(JavaLanguageVersion.of(21))
176+
}
177+
// Automatically create sources and javadoc JARs
178+
withSourcesJar()
179+
withJavadocJar()
180+
}
181+
182+
// Configure sources and javadoc jars after they are created
172183
tasks.named<Jar>("sourcesJar") {
173184
// Add custom naming: v before version and -api before .jar
174185
if (version != "unspecified") {
@@ -187,16 +198,6 @@ tasks.named<Jar>("javadocJar") {
187198
}
188199
}
189200

190-
java {
191-
// Use Java 21 for compilation
192-
toolchain {
193-
languageVersion.set(JavaLanguageVersion.of(21))
194-
}
195-
// Automatically create sources and javadoc JARs
196-
withSourcesJar()
197-
withJavadocJar()
198-
}
199-
200201
kotlin {
201202
jvmToolchain(21) // Ensure Kotlin uses the Java 21 toolchain
202203
}

0 commit comments

Comments
 (0)