Skip to content

Commit

Permalink
Merge pull request #14114 from sonam-vend/enable-global-dep-check
Browse files Browse the repository at this point in the history
[BEAM-10961] turn on enableStrictDependencies globally
  • Loading branch information
ibzib committed Mar 10, 2021
2 parents ae5e1a3 + 7b31eb8 commit 6c2c284
Show file tree
Hide file tree
Showing 102 changed files with 33 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class BeamModulePlugin implements Plugin<Project> {
Map<String, String> classesTriggerCheckerBugs = [:]

/** Controls whether the dependency analysis plugin is enabled. */
boolean enableStrictDependencies = false
boolean enableStrictDependencies = true

/** Override the default "beam-" + `dash separated path` archivesBaseName. */
String archivesBaseName = null
Expand Down Expand Up @@ -1838,6 +1838,7 @@ class BeamModulePlugin implements Plugin<Project> {
}

project.ext.applyJavaNature(
enableStrictDependencies: false,
exportJavadoc: false,
enableSpotbugs: false,
publish: configuration.publish,
Expand Down
1 change: 0 additions & 1 deletion examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ plugins {
}

applyJavaNature(
enableStrictDependencies: true,
exportJavadoc: false,
automaticModuleName: 'org.apache.beam.examples',
)
Expand Down
2 changes: 1 addition & 1 deletion examples/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins { id 'org.apache.beam.module'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}

applyJavaNature(enableStrictDependencies: true, exportJavadoc: false, automaticModuleName: 'org.apache.beam.examples.kotlin')
applyJavaNature(exportJavadoc: false, automaticModuleName: 'org.apache.beam.examples.kotlin')
provideIntegrationTestingDependencies()
enableJavaPerformanceTesting()

Expand Down
1 change: 1 addition & 0 deletions release/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ val library = project.extensions.extraProperties["library"] as Map<String, Map<S
dependencies {
compile(library.getValue("groovy").getValue("groovy_all"))
compile("commons-cli:commons-cli:1.2")
permitUnusedDeclared("commons-cli:commons-cli:1.2") // BEAM-11761
}

task("runJavaExamplesValidationTask") {
Expand Down
1 change: 0 additions & 1 deletion runners/core-construction-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
classesTriggerCheckerBugs: [
'WindowIntoTranslation': 'https://github.com/typetools/checker-framework/issues/3791',
'FlattenTranslator': 'https://github.com/typetools/checker-framework/issues/3791',
Expand Down
1 change: 0 additions & 1 deletion runners/core-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
classesTriggerCheckerBugs: [
'InMemoryStateInternals': 'https://github.com/typetools/checker-framework/issues/3792',
'MergingActiveWindowSetTest': 'https://github.com/typetools/checker-framework/issues/3792',
Expand Down
1 change: 0 additions & 1 deletion runners/direct-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def dependOnProjects = [":runners:core-construction-java",
]

applyJavaNature(
enableStrictDependencies:true,
automaticModuleName: 'org.apache.beam.runners.direct',
classesTriggerCheckerBugs: [
'ImpulseEvaluatorFactory': 'https://github.com/typetools/checker-framework/issues/3791',
Expand Down
1 change: 0 additions & 1 deletion runners/extensions-java/metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
exportJavadoc: false,
automaticModuleName: 'org.apache.beam.runners.extensions.metrics',
)
Expand Down
1 change: 0 additions & 1 deletion runners/flink/job-server/flink_job_server.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ apply plugin: 'application'
mainClassName = "org.apache.beam.runners.flink.FlinkJobServerDriver"

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.flink.jobserver',
archivesBaseName: project.hasProperty('archives_base_name') ? archives_base_name : archivesBaseName,
validateShadowJar: false,
Expand Down
1 change: 1 addition & 0 deletions runners/google-cloud-dataflow-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: false,
automaticModuleName: 'org.apache.beam.runners.dataflow',
classesTriggerCheckerBugs: [
'PrimitiveParDoSingleFactory': 'https://github.com/typetools/checker-framework/issues/3791',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(publish: false, exportJavadoc: false)
applyJavaNature(enableStrictDependencies: false, publish: false, exportJavadoc: false)
// Evaluate the given project before this one, to allow referencing
// its sourceSets.test.output directly.
evaluationDependsOn(":examples:java")
Expand Down
2 changes: 1 addition & 1 deletion runners/google-cloud-dataflow-java/examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(publish: false, exportJavadoc: false)
applyJavaNature(enableStrictDependencies: false, publish: false, exportJavadoc: false)
// Evaluate the given project before this one, to allow referencing
// its sourceSets.test.output directly.
evaluationDependsOn(":examples:java")
Expand Down
1 change: 1 addition & 0 deletions runners/google-cloud-dataflow-java/worker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def DATAFLOW_VERSION = "dataflow.version"
def google_api_services_dataflow = project.hasProperty(DATAFLOW_VERSION) ? "com.google.apis:google-api-services-dataflow:" + getProperty(DATAFLOW_VERSION) : library.java.google_api_services_dataflow

applyJavaNature(
enableStrictDependencies: false,
archivesBaseName: 'beam-runners-google-cloud-dataflow-java-fn-api-worker',
publish: false,
exportJavadoc: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def excluded_dependencies = [
]

applyJavaNature(
enableStrictDependencies: false,
archivesBaseName: 'beam-runners-google-cloud-dataflow-java-legacy-worker',
publish: false,
classesTriggerCheckerBugs: [
Expand Down
1 change: 0 additions & 1 deletion runners/java-fn-execution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.fnexecution',
)

Expand Down
1 change: 0 additions & 1 deletion runners/java-job-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.jobservice',
)

Expand Down
1 change: 0 additions & 1 deletion runners/jet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies : true,
automaticModuleName: 'org.apache.beam.runners.jet',
)

Expand Down
1 change: 0 additions & 1 deletion runners/local-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.local',
archivesBaseName: 'beam-runners-local-java-core',

Expand Down
2 changes: 1 addition & 1 deletion runners/portability/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import groovy.json.JsonOutput
*/

plugins { id 'org.apache.beam.module' }
applyJavaNature(enableStrictDependencies:true, automaticModuleName: 'org.apache.beam.runners.portability')
applyJavaNature(automaticModuleName: 'org.apache.beam.runners.portability')
applyPythonNature()

description = "Apache Beam :: Runners :: Portability :: Java"
Expand Down
1 change: 0 additions & 1 deletion runners/samza/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies : true,
exportJavadoc: false,
classesTriggerCheckerBugs: [
'GroupWithoutRepartition': 'https://github.com/typetools/checker-framework/issues/3791',
Expand Down
1 change: 0 additions & 1 deletion runners/samza/job-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ apply plugin: 'application'
mainClassName = "org.apache.beam.runners.samza.SamzaJobServerDriver"

applyJavaNature(
enableStrictDependencies : true,
automaticModuleName: 'org.apache.beam.runners.samza.jobserver',
validateShadowJar: false,

Expand Down
1 change: 0 additions & 1 deletion runners/spark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import java.util.stream.Collectors

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.spark',
classesTriggerCheckerBugs: [
'SparkAssignWindowFn': 'https://github.com/typetools/checker-framework/issues/3793',
Expand Down
1 change: 0 additions & 1 deletion runners/spark/job-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ apply plugin: 'application'
mainClassName = "org.apache.beam.runners.spark.SparkJobServerDriver"

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.runners.spark.jobserver',
validateShadowJar: false,
exportJavadoc: false,
Expand Down
1 change: 0 additions & 1 deletion runners/twister2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import groovy.json.JsonOutput
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies:true,
automaticModuleName: 'org.apache.beam.runners.twister2',
)

Expand Down
1 change: 0 additions & 1 deletion sdks/java/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk',
classesTriggerCheckerBugs: [
'DoFnTester': 'https://github.com/typetools/checker-framework/issues/3776',
Expand Down
1 change: 0 additions & 1 deletion sdks/java/expansion-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.expansion.service')

description = "Apache Beam :: SDKs :: Java :: Expansion Service"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/euphoria/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
exportJavadoc: false,
automaticModuleName: 'org.apache.beam.sdk.extensions.euphoria',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.gcp')

description = "Apache Beam :: SDKs :: Java :: Extensions :: Google Cloud Platform Core"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/jackson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.jackson',
archivesBaseName: 'beam-sdks-java-extensions-json-jackson'
)
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/join-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.joinlibrary'
)

Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/kryo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ ext {
}

applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.extensions.kryo',
enableStrictDependencies: true,
exportJavadoc: false,
shadowClosure: {
dependencies {
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/ml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.ml'
)

Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
generatedClassPatterns: [
/^org\.apache\.beam\.sdk\.extensions\.protobuf\.PayloadMessages/,
/^org\.apache\.beam\.sdk\.extensions\.protobuf\.Proto2CoderTestMessages/,
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sketching/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sketching')

description = "Apache Beam :: SDKs :: Java :: Extensions :: Sketching"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sorter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import java.util.stream.Collectors

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sorter')

description = "Apache Beam :: SDKs :: Java :: Extensions :: Sorter"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ plugins {
id 'ca.coglinc.javacc'
}
applyJavaNature(
enableStrictDependencies: true,
generatedClassPatterns: [
/^org\.apache\.beam\.sdk\.extensions\.sql\.impl\.parser\.impl.*/,
],
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/datacatalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import groovy.json.JsonOutput
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.datacatalog')

dependencies {
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/expansion-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdks.extensions.sql.expansion',
validateShadowJar: false,
shadowClosure: {
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/hcatalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.meta.provider.hcatalog',
classesTriggerCheckerBugs: [
'HCatalogTable': 'TODO: file a bug report',
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.extensions.sql.jdbc',
enableStrictDependencies: true,
exportJavadoc: false,
testShadowJar: true,
validateShadowJar: false,
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/perf-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.meta.provider')
provideIntegrationTestingDependencies()
enableJavaPerformanceTesting()
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/udf-test-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ plugins {
}

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.provider',
publish: false,
)
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/udf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
plugins { id 'org.apache.beam.module' }

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.udf')

description = "Apache Beam :: SDKs :: Java :: Extensions :: SQL :: UDF"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/sql/zetasql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ plugins {
}

applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.zetasql',
)

Expand Down
1 change: 0 additions & 1 deletion sdks/java/extensions/zetasketch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import groovy.json.JsonOutput

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.extensions.zetasketch')

description = "Apache Beam :: SDKs :: Java :: Extensions :: ZetaSketch"
Expand Down
1 change: 0 additions & 1 deletion sdks/java/fn-execution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableStrictDependencies: true,
automaticModuleName: 'org.apache.beam.sdk.fn',
)

Expand Down
1 change: 0 additions & 1 deletion sdks/java/harness/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def dependOnProjects = [":sdks:java:fn-execution",
":runners:core-java", ":runners:core-construction-java"]

applyJavaNature(
enableStrictDependencies: true,
classesTriggerCheckerBugs: [
'AssignWindowsRunner': 'https://github.com/typetools/checker-framework/issues/3794',
'WindowMergingFnRunner': 'https://github.com/typetools/checker-framework/issues/3794',
Expand Down
1 change: 0 additions & 1 deletion sdks/java/io/amazon-web-services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ plugins {
}

applyJavaNature(
enableStrictDependencies:true,
automaticModuleName: 'org.apache.beam.sdk.io.aws',
)

Expand Down

0 comments on commit 6c2c284

Please sign in to comment.