[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-19 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r395398347
 
 

 ##
 File path: 
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##
 @@ -1258,23 +1258,20 @@ class BeamModulePlugin implements Plugin {
 exclude group: "org.hamcrest", module: "hamcrest-all"
   }
 
-  // Force usage of the libraries defined within our common set found in 
the root
+  // For tests, force usage of the libraries defined within our common set 
found in the root
   // build.gradle instead of using Gradles default dependency resolution 
mechanism
   // which chooses the latest version available.
   //
   // TODO: Figure out whether we should force all dependency conflict 
resolution
-  // to occur in the "shadow" and "shadowTest" configurations.
+  // to occur in the "shadowTest" configurations.
   project.configurations.all { config ->
-// When running beam_Dependency_Check, resolutionStrategy should not 
be used; otherwise
-// gradle-versions-plugin does not report the latest versions of the 
dependencies.
-def startTasks = project.gradle.startParameter.taskNames
-def inDependencyUpdates = 'dependencyUpdates' in startTasks || 
'runBeamDependencyCheck' in startTasks
-
-// The "errorprone" configuration controls the classpath used by 
errorprone static analysis, which
-// has different dependencies than our project.
-if (config.getName() != "errorprone" && !inDependencyUpdates) {
+String configName = config.getName()
+if (configName.toLowerCase().contains('test')) {
   config.resolutionStrategy {
-force project.library.java.values()
+force project.library.java.junit,
+project.library.java.hamcrest_core,
+project.library.java.guava, // 
sdks:java:io:google-cloud-platform needs this
 
 Review comment:
   I find centrally managing `force` more clear.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-19 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r395398249
 
 

 ##
 File path: sdks/java/io/google-cloud-platform/build.gradle
 ##
 @@ -75,6 +75,7 @@ dependencies {
   compile library.java.proto_google_common_protos
   compile library.java.protobuf_java
   compile library.java.slf4j_api
+  compileOnly library.java.hamcrest_library // should not appear in users' 
class path
 
 Review comment:
   Updated to `provided`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-18 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r394739760
 
 

 ##
 File path: sdks/java/io/google-cloud-platform/build.gradle
 ##
 @@ -75,6 +75,7 @@ dependencies {
   compile library.java.proto_google_common_protos
   compile library.java.protobuf_java
   compile library.java.slf4j_api
+  compileOnly library.java.hamcrest_library // should not appear in users' 
class path
 
 Review comment:
   This module's `org.apache.beam.sdk.io.gcp.pubsub.TestPubsub` in "main" (not 
test) uses Hamcrest's matchers. Therefore declaring the dependency.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-18 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r394739168
 
 

 ##
 File path: 
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##
 @@ -1258,23 +1258,20 @@ class BeamModulePlugin implements Plugin {
 exclude group: "org.hamcrest", module: "hamcrest-all"
   }
 
-  // Force usage of the libraries defined within our common set found in 
the root
+  // For tests, force usage of the libraries defined within our common set 
found in the root
   // build.gradle instead of using Gradles default dependency resolution 
mechanism
   // which chooses the latest version available.
   //
   // TODO: Figure out whether we should force all dependency conflict 
resolution
-  // to occur in the "shadow" and "shadowTest" configurations.
+  // to occur in the "shadowTest" configurations.
   project.configurations.all { config ->
-// When running beam_Dependency_Check, resolutionStrategy should not 
be used; otherwise
-// gradle-versions-plugin does not report the latest versions of the 
dependencies.
-def startTasks = project.gradle.startParameter.taskNames
-def inDependencyUpdates = 'dependencyUpdates' in startTasks || 
'runBeamDependencyCheck' in startTasks
 
 Review comment:
   I confirmed `./gradlew runBeamDependencyCheck` works as expected with this 
PR.
   https://gist.github.com/suztomo/7077fcea856fba6761f17da3977b6c82


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-18 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r394739488
 
 

 ##
 File path: 
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##
 @@ -1258,23 +1258,20 @@ class BeamModulePlugin implements Plugin {
 exclude group: "org.hamcrest", module: "hamcrest-all"
   }
 
-  // Force usage of the libraries defined within our common set found in 
the root
+  // For tests, force usage of the libraries defined within our common set 
found in the root
   // build.gradle instead of using Gradles default dependency resolution 
mechanism
   // which chooses the latest version available.
   //
   // TODO: Figure out whether we should force all dependency conflict 
resolution
-  // to occur in the "shadow" and "shadowTest" configurations.
+  // to occur in the "shadowTest" configurations.
   project.configurations.all { config ->
-// When running beam_Dependency_Check, resolutionStrategy should not 
be used; otherwise
-// gradle-versions-plugin does not report the latest versions of the 
dependencies.
-def startTasks = project.gradle.startParameter.taskNames
-def inDependencyUpdates = 'dependencyUpdates' in startTasks || 
'runBeamDependencyCheck' in startTasks
-
-// The "errorprone" configuration controls the classpath used by 
errorprone static analysis, which
-// has different dependencies than our project.
-if (config.getName() != "errorprone" && !inDependencyUpdates) {
 
 Review comment:
   Before this PR, the effect of `force` was unclear; this file had to 
special-case "errorprone" and "runBeamDependencyCheck" when unexpected behavior 
happened.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [beam] suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build

2020-03-18 Thread GitBox
suztomo commented on a change in pull request #11168: [BEAM-9542] Limit and 
clarify the effect of "force" in Java build
URL: https://github.com/apache/beam/pull/11168#discussion_r394739600
 
 

 ##
 File path: sdks/java/core/build.gradle
 ##
 @@ -87,6 +87,7 @@ dependencies {
   provided 'io.airlift:aircompressor:0.16' 
   provided 'com.facebook.presto.hadoop:hadoop-apache2:3.2.0-1'
   shadowTest library.java.jackson_dataformat_yaml
+  shadowTest library.java.junit
 
 Review comment:
   This module uses JUnit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services