Skip to content

Commit e33eedd

Browse files
committed
add dev mode where warnings don't fail the test
1 parent e38fd24 commit e33eedd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

conventions/src/main/kotlin/otel.java-conventions.gradle.kts

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ tasks.withType<JavaCompile>().configureEach {
7373
// We suppress the "options" warning because it prevents compilation on modern JDKs
7474
"-Xlint:-options",
7575
// jdk21 generates more serial warnings than previous versions
76-
"-Xlint:-serial",
77-
78-
// Fail build on any warning
79-
"-Werror"
76+
"-Xlint:-serial"
8077
)
8178
)
79+
if (System.getProperty("dev") != "true") {
80+
// Fail build on any warning
81+
compilerArgs.add("-Werror")
82+
}
8283
val defaultJavaVersion = otelJava.maxJavaVersionSupported.getOrElse(DEFAULT_JAVA_VERSION).majorVersion.toInt()
8384
if (Math.max(otelJava.minJavaVersionSupported.get().majorVersion.toInt(), defaultJavaVersion) >= 21) {
8485
// new warning in jdk21

0 commit comments

Comments
 (0)