Skip to content

Commit

Permalink
Enable errorprone globally
Browse files Browse the repository at this point in the history
  • Loading branch information
iemejia committed Jun 22, 2018
1 parent 5d25792 commit 359110e
Show file tree
Hide file tree
Showing 52 changed files with 64 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BeamModulePlugin implements Plugin<Project> {
boolean enableErrorProne = true

/** Controls whether compiler warnings are treated as errors. */
boolean failOnWarning = false
boolean failOnWarning = true

/**
* List of additional lint warnings to disable.
Expand Down Expand Up @@ -351,7 +351,6 @@ class BeamModulePlugin implements Plugin<Project> {
datastore_v1_proto_client : "com.google.cloud.datastore:datastore-v1-proto-client:1.4.0",
datastore_v1_protos : "com.google.cloud.datastore:datastore-v1-protos:1.3.0",
error_prone_annotations : "com.google.errorprone:error_prone_annotations:2.0.15",
findbugs_annotations : "com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1",
findbugs_jsr305 : "com.google.code.findbugs:jsr305:3.0.1",
gax_grpc : "com.google.api:gax-grpc:0.20.0",
google_api_client : "com.google.api-client:google-api-client:$google_clients_version",
Expand Down Expand Up @@ -595,6 +594,14 @@ class BeamModulePlugin implements Plugin<Project> {
apt auto_service
testCompileOnly auto_service
testApt auto_service

// These dependencies are needed to avoid error-prone warnings on package-info.java files,
// also to include the annotations to supress warnings.
def findbugs_annotations = "com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1"
compileOnly findbugs_annotations
apt findbugs_annotations
testCompileOnly findbugs_annotations
testApt findbugs_annotations
}

// Add the optional and provided configurations for dependencies
Expand Down
2 changes: 1 addition & 1 deletion examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Examples :: Java"
ext.summary = """Apache Beam SDK provides a simple, Java-based
Expand Down
4 changes: 1 addition & 3 deletions runners/apex/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Apex"

Expand All @@ -35,7 +35,6 @@ configurations {
}

dependencies {
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow project(path: ":beam-runners-core-construction-java", configuration: "shadow")
Expand All @@ -46,7 +45,6 @@ dependencies {
shadow library.java.commons_lang3
shadow library.java.findbugs_jsr305
shadow library.java.apex_engine
testCompileOnly library.java.findbugs_annotations
shadowTest project(path: ":beam-sdks-java-core", configuration: "shadowTest")
// ApexStateInternalsTest extends abstract StateInternalsTest
shadowTest project(path: ":beam-runners-core-java", configuration: "shadowTest")
Expand Down
4 changes: 1 addition & 3 deletions runners/core-construction-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Core Construction Java"
ext.summary = """Beam Runners Core provides utilities to aid runner authors interact with a Pipeline
Expand All @@ -34,7 +34,6 @@ test {

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
shadow project(path: ":beam-model-job-management", configuration: "shadow")
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
Expand All @@ -47,7 +46,6 @@ dependencies {
shadow library.java.slf4j_api
shadow library.java.grpc_core
shadow library.java.grpc_stub
testCompileOnly library.java.findbugs_annotations
shadowTest library.java.hamcrest_core
shadowTest library.java.hamcrest_library
shadowTest library.java.junit
Expand Down
4 changes: 1 addition & 3 deletions runners/core-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Core Java"
ext.summary = "Beam Runners Core provides utilities to aid runner authors."
Expand All @@ -32,7 +32,6 @@ test {

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow project(path: ":beam-model-fn-execution", configuration: "shadow")
Expand All @@ -41,7 +40,6 @@ dependencies {
shadow library.java.grpc_core
shadow library.java.grpc_stub
shadow library.java.joda_time
testCompileOnly library.java.findbugs_annotations
shadowTest project(path: ":beam-sdks-java-core", configuration: "shadowTest")
shadowTest library.java.junit
shadowTest library.java.hamcrest_core
Expand Down
2 changes: 1 addition & 1 deletion runners/direct-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def dependOnProjects = [":beam-model-pipeline", ":beam-runners-core-construction
":beam-runners-java-fn-execution", ":beam-sdks-java-fn-execution"]

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true, shadowClosure: DEFAULT_SHADOW_CLOSURE << {
applyJavaNature(shadowClosure: DEFAULT_SHADOW_CLOSURE << {
dependencies {
include(dependency(library.java.protobuf_java))
include(dependency(library.java.protobuf_java_util))
Expand Down
19 changes: 8 additions & 11 deletions runners/extensions-java/metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Extensions Java :: Metrics"
ext.summary = "Beam Runners Extensions Metrics provides implementations of runners core metrics APIs."


dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow library.java.jackson_databind
shadow library.java.jackson_datatype_joda
shadow library.java.findbugs_jsr305
testCompileOnly library.java.findbugs_annotations
shadowTest library.java.joda_time
shadowTest library.java.junit
compile library.java.guava
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow library.java.jackson_databind
shadow library.java.jackson_datatype_joda
shadow library.java.findbugs_jsr305
shadowTest library.java.joda_time
shadowTest library.java.junit
}
3 changes: 1 addition & 2 deletions runners/flink/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()


description = "Apache Beam :: Runners :: Flink"
Expand Down Expand Up @@ -49,7 +49,6 @@ def flink_version = "1.5.0"

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow project(path: ":beam-runners-core-java", configuration: "shadow")
shadow project(path: ":beam-runners-core-construction-java", configuration: "shadow")
Expand Down
4 changes: 1 addition & 3 deletions runners/gearpump/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Gearpump"

Expand All @@ -38,7 +38,6 @@ configurations {

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
compileOnly "com.typesafe:config:1.3.0"
compileOnly "org.scala-lang:scala-library:2.11.8"
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
Expand All @@ -49,7 +48,6 @@ dependencies {
shadow library.java.joda_time
shadow library.java.jackson_annotations
shadow library.java.findbugs_jsr305
testCompileOnly library.java.findbugs_annotations
shadowTest project(path: ":beam-sdks-java-core", configuration: "shadowTest")
shadowTest library.java.junit
shadowTest library.java.hamcrest_core
Expand Down
2 changes: 1 addition & 1 deletion runners/google-cloud-dataflow-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Google Cloud Dataflow"

Expand Down
3 changes: 1 addition & 2 deletions runners/java-fn-execution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Java Fn Execution"

dependencies {
compile library.java.guava
compile library.java.findbugs_annotations
compile project(path: ":beam-runners-core-construction-java", configuration: "shadow")
provided project(path: ":beam-sdks-java-harness")
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
Expand Down
3 changes: 1 addition & 2 deletions runners/local-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Local Java Core"

Expand All @@ -31,7 +31,6 @@ dependencies {
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow library.java.joda_time
shadow library.java.findbugs_jsr305
shadow library.java.findbugs_annotations
shadowTest library.java.hamcrest_core
shadowTest library.java.hamcrest_library
shadowTest library.java.junit
Expand Down
4 changes: 1 addition & 3 deletions runners/reference/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Reference :: Java"
ext.summary = """A Java implementation of the Beam Model which utilizes the portability
framework to execute user-definied functions."""


dependencies {
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
shadow project(path: ":beam-runners-core-construction-java", configuration: "shadow")
shadow project(path: ":beam-sdks-java-fn-execution", configuration: "shadow")
shadow library.java.slf4j_api
testCompileOnly library.java.findbugs_annotations
shadowTest project(path: ":beam-runners-core-construction-java", configuration: "shadowTest")
testCompile library.java.hamcrest_core
testCompile library.java.junit
Expand Down
4 changes: 1 addition & 3 deletions runners/spark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: Runners :: Spark"

Expand Down Expand Up @@ -53,7 +53,6 @@ test {
}

dependencies {
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-model-pipeline", configuration: "shadow")
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow project(path: ":beam-runners-core-construction-java", configuration: "shadow")
Expand All @@ -78,7 +77,6 @@ dependencies {
provided "org.apache.zookeeper:zookeeper:3.4.11"
provided "org.scala-lang:scala-library:2.11.8"
provided "com.esotericsoftware.kryo:kryo:2.21"
testCompileOnly library.java.findbugs_annotations
shadowTest project(path: ":beam-sdks-java-io-kafka", configuration: "shadow")
shadowTest project(path: ":beam-sdks-java-core", configuration: "shadowTest")
// SparkStateInternalsTest extends abstract StateInternalsTest
Expand Down
2 changes: 1 addition & 1 deletion sdks/java/build-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: SDKs :: Java :: Build Tools"
2 changes: 0 additions & 2 deletions sdks/java/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ dependencies {
compile library.java.commons_compress
compile library.java.commons_lang3
compile library.java.guava_testlib
compileOnly library.java.findbugs_annotations
testCompileOnly library.java.findbugs_annotations
shadow library.java.jackson_core
shadow library.java.jackson_annotations
shadow library.java.jackson_databind
Expand Down
4 changes: 1 addition & 3 deletions sdks/java/extensions/jackson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: SDKs :: Java :: Extensions :: Jackson"
ext.summary = "Jackson extension provides PTransforms for deserializing and generating JSON strings."

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow library.java.jackson_databind
testCompile project(path: ":beam-runners-direct-java", configuration: "shadow")
testCompile library.java.hamcrest_core
testCompile library.java.hamcrest_library
testCompile library.java.junit
testCompileOnly library.java.findbugs_annotations
}
4 changes: 1 addition & 3 deletions sdks/java/extensions/join-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: SDKs :: Java :: Extensions :: Join library"

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
testCompile project(path: ":beam-runners-direct-java", configuration: "shadow")
testCompile library.java.hamcrest_core
testCompile library.java.hamcrest_library
testCompile library.java.junit
testCompileOnly library.java.findbugs_annotations
}
3 changes: 1 addition & 2 deletions sdks/java/extensions/protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()
applyGrpcNature()

description = "Apache Beam :: SDKs :: Java :: Extensions :: Protobuf"
Expand All @@ -27,7 +27,6 @@ dependencies {
compile library.java.guava
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow library.java.protobuf_java
shadow library.java.findbugs_annotations
testCompile project(path: ":beam-sdks-java-core", configuration: "shadowTest")
testCompile library.java.hamcrest_core
testCompile library.java.hamcrest_library
Expand Down
4 changes: 1 addition & 3 deletions sdks/java/extensions/sketching/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyJavaNature(failOnWarning: true)
applyJavaNature()

description = "Apache Beam :: SDKs :: Java :: Extensions :: Sketching"

Expand All @@ -26,12 +26,10 @@ def tdigest_version = "3.2"

dependencies {
compile library.java.guava
compileOnly library.java.findbugs_annotations
shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
shadow "com.clearspring.analytics:stream:$streamlib_version"
shadow "com.tdunning:t-digest:$tdigest_version"
shadow library.java.slf4j_api
testCompileOnly library.java.findbugs_annotations
shadowTest library.java.avro
shadowTest library.java.commons_lang3
shadowTest project(path: ":beam-sdks-java-core", configuration: "shadowTest")
Expand Down
Loading

0 comments on commit 359110e

Please sign in to comment.