@@ -267,48 +267,29 @@ Command-line utility to analyze the state of the bazel build graph
267267
268268First, add the following snippet to your project:
269269
270- #### WORKSPACE Snippet
270+ #### Bzlmod snippet
271271
272272``` bazel
273- load(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_jar" )
274-
275- http_jar(
276- name = " bazel_diff" ,
277- urls = [
278- " https://github.com/Tinder/bazel-diff/releases/download/6.1.0/bazel-diff_deploy.jar" ,
279- ],
280- sha256 = " 5d90de4561afd1e711bc62956560a9dfcbb4454bd6b209d6e68272b65c3cb50a" ,
281- )
273+ bazel_dep(name = " bazel-diff" , version = " 9.0.3" )
282274```
283275
284- #### MODULE.bazel Snippet (if you are using Bzlmod)
276+ You can now run the tool with:
285277
286- ``` bazel
287- http_jar = use_repo_rule(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_jar" )
288- http_jar(
289- name = " bazel_diff" ,
290- urls = [
291- " https://github.com/Tinder/bazel-diff/releases/download/7.0.0/bazel-diff_deploy.jar"
292- ],
293- sha256 = " 0b9e32f9c20e570846b083743fe967ae54d13e2a1f7364983e0a7792979442be" ,
294- )
278+ ``` terminal
279+ bazel run @bazel-diff//cli:bazel-diff
295280```
296281
297282#### WORKSPACE snippet
298283
299284``` bazel
300285http_jar = use_repo_rule(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_jar" )
301286http_jar(
302- name = " bazel_diff " ,
287+ name = " bazel-diff " ,
303288 urls = [
304289 " https://github.com/Tinder/bazel-diff/releases/download/7.0.0/bazel-diff_deploy.jar"
305290 ],
306291 sha256 = " 0b9e32f9c20e570846b083743fe967ae54d13e2a1f7364983e0a7792979442be" ,
307292)
308-
309- load(" //@bazel_diff:repositories.bzl" , " bazel_diff_dependencies" )
310-
311- bazel_diff_dependencies()
312293```
313294
314295Second, add in your root ` BUILD.bazel ` file:
@@ -319,7 +300,7 @@ load("@rules_java//java:defs.bzl", "java_binary")
319300java_binary(
320301 name = " bazel-diff" ,
321302 main_class = " com.bazel_diff.Main" ,
322- runtime_deps = [" @bazel_diff//jar " ],
303+ runtime_deps = [" @bazel-diff//cli:bazel-diff " ],
323304)
324305```
325306
@@ -371,20 +352,20 @@ Add the following to your `WORKSPACE` file to add the external repositories, rep
371352load(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_archive" )
372353
373354http_archive(
374- name = " bazel_diff " ,
355+ name = " bazel-diff " ,
375356 urls = [
376357 " RELEASE_ARCHIVE_URL" ,
377358 ],
378359 sha256 = " UPDATE_ME" ,
379360 strip_prefix = " UPDATE_ME"
380361)
381362
382- load(" @bazel_diff //:repositories.bzl" , " bazel_diff_dependencies" )
363+ load(" @bazel-diff //:repositories.bzl" , " bazel_diff_dependencies" )
383364
384365bazel_diff_dependencies()
385366
386367load(" @rules_jvm_external//:defs.bzl" , " maven_install" )
387- load(" @bazel_diff //:artifacts.bzl" , " BAZEL_DIFF_MAVEN_ARTIFACTS" )
368+ load(" @bazel-diff //:artifacts.bzl" , " BAZEL_DIFF_MAVEN_ARTIFACTS" )
388369
389370maven_install(
390371 name = " bazel_diff_maven" ,
@@ -399,7 +380,7 @@ maven_install(
399380Now you can simply run ` bazel-diff ` from your project:
400381
401382``` terminal
402- bazel run @bazel_diff// :bazel-diff -- bazel-diff -h
383+ bazel run @bazel-diff//cli :bazel-diff -- bazel-diff -h
403384```
404385
405386## Learn More
0 commit comments