diff --git a/service/tooling.gradle b/service/tooling.gradle index 7f706dc..2df5fd4 100644 --- a/service/tooling.gradle +++ b/service/tooling.gradle @@ -12,13 +12,21 @@ spotless { } } -compileJava.dependsOn spotlessApply - idea.module.downloadJavadoc = true // Immutables has incremental compilation disabled by default tasks { + boolean isCiServer = System.getenv().containsKey("CI") + compileJava { options.compilerArgs.add("-Aimmutables.gradle.incremental") + + // enforce consistency in CI environment, and + // enable auto-format in development environment + if (isCiServer) { + dependsOn(spotlessCheck) + } else { + dependsOn(spotlessApply) + } } }