bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
45 stars 30 forks source link

Modified generate_workspace WORKSPACE file so that it uses the load.bzl format. #29

Closed petroseskinder closed 7 years ago

petroseskinder commented 7 years ago

I was having an issue with adding a new dependency to a maven_jar and found it much easier adding a new dependency using the load.bzl format rather than using the old format.

I figure it makes more sense to refactor the WORKSPACE to this format, before presenting that issue. That said, something I found particularly awkward/cumbersome was that whenever I wanted to upgrade or add a new dependency, I would have to execute the following command:

java -jar generate_workspace_deploy.jar \
-a=com.google.code.findbugs:jsr305:3.0.1 \
-a=org.codehaus.plexus:plexus-utils:jar:3.0.24 \
-a=org.codehaus.plexus:plexus-component-annotations:1.7.1 \
-a=org.codehaus.plexus:plexus-interpolation:1.24 \
-a=com.google.guava:guava:20.0 \
-a=org.apache.maven:maven-artifact:3.5.0 \
-a=org.mockito:mockito-all:1.9.5 \
-a=junit:junit:4.4 \
-a=com.google.truth:truth:0.30
#<-- insert new thing here

Bah!😫 It would be nice if we didn't have to do all that. #20 and Chris's comment in #25.Stripe uses an intermediary yaml file to make upgrading easier.

reviewer: @kchodorow cc: @hhclam

bazel-io commented 7 years ago

Can one of the admins verify this patch?

petroseskinder commented 7 years ago

Good idea. Just a few nits, the java libraries aren't actually used anywhere.

That was a little confusing for me. Is the intended approach to use the java_library or depending directly the maven_jar? I can see how the java_library may be preferably, in that bazel won't try to fetch the java_library as it would the maven_jar.