Skip to content

Commit

Permalink
java/kotlin build: allow warning locally with explicit optin (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnovais authored Oct 25, 2024
1 parent 011de09 commit d978d0d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ plugins {

task compileAll

// to allow to have unused vars/imports,etc for faster debugging/prototyping
// instead of deleting and re-adding code all the time
def allowCompilationWarnings = System.getenv('LINEA_DEV_ALLOW_WARNINGS') != null

allprojects {
repositories { mavenCentral() }

Expand All @@ -22,7 +26,7 @@ allprojects {
tasks.withType(KotlinCompile).configureEach {
compileAll.dependsOn it
compilerOptions {
allWarningsAsErrors = true
allWarningsAsErrors = !allowCompilationWarnings
}
}

Expand All @@ -38,8 +42,12 @@ allprojects {
'-Xlint:finally',
'-Xlint:static',
'-Xlint:deprecation',
'-Werror'
])
if (!allowCompilationWarnings) {
options.compilerArgs.addAll([
'-Werror'
])
}

if (!project.path.contains("testing-tools")) {
// testing tools have 100+ errors because of this
Expand Down

0 comments on commit d978d0d

Please sign in to comment.