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
2 changes: 1 addition & 1 deletion benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ configure<SpotlessExtension> {
}
}

val buf: Configuration by configurations.creating
val buf = configurations.create("buf")

tasks.register("configureBuf") {
description = "Installs the Buf CLI."
Expand Down
10 changes: 4 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (matchResult != null) {
}
val releaseVersion = project.findProperty("releaseVersion") as String? ?: snapshotVersion

val buf: Configuration by configurations.creating
val buf = configurations.create("buf")
val bufLicenseHeaderCLIFile =
project.layout.buildDirectory
.file("gobin/license-header")
Expand Down Expand Up @@ -268,11 +268,9 @@ tasks.matching { it.name == "sourcesJar" }.configureEach {

tasks.withType<JavaCompile> {
dependsOn("generate")
if (JavaVersion.current().isJava9Compatible) {
doFirst {
options.compilerArgs = mutableListOf("--release", "8")
}
}
options.release = 8
// JDK 9+ javac warns that release 8 is obsolete.
options.compilerArgs.add("-Xlint:-options")
// Disable errorprone on generated code
options.errorprone.excludedPaths.set(".*/build/generated/.*")
if (!name.lowercase().contains("test")) {
Expand Down
10 changes: 4 additions & 6 deletions conformance/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ java {
targetCompatibility = JavaVersion.VERSION_21
}

val buf: Configuration by configurations.creating
val buf = configurations.create("buf")

tasks.register("configureBuf") {
description = "Installs the Buf CLI."
Expand Down Expand Up @@ -96,11 +96,9 @@ sourceSets {

tasks.withType<JavaCompile> {
dependsOn("generateConformance")
if (JavaVersion.current().isJava9Compatible) {
doFirst {
options.compilerArgs = mutableListOf("--release", "8")
}
}
options.release = 8
// JDK 9+ javac warns that release 8 is obsolete.
options.compilerArgs.add("-Xlint:-options")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to not use --release 8 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conformance module requires Java 21+ so the build has to use a later version than 9 to work. Using the gradle release property is cleaner if we don't have to compile with a Java 8 javac.

// Disable errorprone on generated code
options.errorprone.excludedPaths.set(".*/build/generated/sources/bufgen/.*")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version =

[plugins]
errorprone = { id = "net.ltgt.errorprone", version = "5.1.1" }
jmh = { id = "me.champeau.jmh", version = "0.7.3" }
jmh = { id = "me.champeau.jmh", version = "0.7.4" }
maven = { id = "com.vanniktech.maven.publish.base", version.ref = "maven-publish" }
osdetector = { id = "com.google.osdetector", version = "1.7.3" }
Loading