@@ -267,48 +267,29 @@ Command-line utility to analyze the state of the bazel build graph
267
267
268
268
First, add the following snippet to your project:
269
269
270
- #### WORKSPACE Snippet
270
+ #### Bzlmod snippet
271
271
272
272
``` 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" )
282
274
```
283
275
284
- #### MODULE.bazel Snippet (if you are using Bzlmod)
276
+ You can now run the tool with:
285
277
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
295
280
```
296
281
297
282
#### WORKSPACE snippet
298
283
299
284
``` bazel
300
285
http_jar = use_repo_rule(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_jar" )
301
286
http_jar(
302
- name = " bazel_diff " ,
287
+ name = " bazel-diff " ,
303
288
urls = [
304
289
" https://github.com/Tinder/bazel-diff/releases/download/7.0.0/bazel-diff_deploy.jar"
305
290
],
306
291
sha256 = " 0b9e32f9c20e570846b083743fe967ae54d13e2a1f7364983e0a7792979442be" ,
307
292
)
308
-
309
- load(" //@bazel_diff:repositories.bzl" , " bazel_diff_dependencies" )
310
-
311
- bazel_diff_dependencies()
312
293
```
313
294
314
295
Second, add in your root ` BUILD.bazel ` file:
@@ -319,7 +300,7 @@ load("@rules_java//java:defs.bzl", "java_binary")
319
300
java_binary(
320
301
name = " bazel-diff" ,
321
302
main_class = " com.bazel_diff.Main" ,
322
- runtime_deps = [" @bazel_diff//jar " ],
303
+ runtime_deps = [" @bazel-diff//cli:bazel-diff " ],
323
304
)
324
305
```
325
306
@@ -371,20 +352,20 @@ Add the following to your `WORKSPACE` file to add the external repositories, rep
371
352
load(" @bazel_tools//tools/build_defs/repo:http.bzl" , " http_archive" )
372
353
373
354
http_archive(
374
- name = " bazel_diff " ,
355
+ name = " bazel-diff " ,
375
356
urls = [
376
357
" RELEASE_ARCHIVE_URL" ,
377
358
],
378
359
sha256 = " UPDATE_ME" ,
379
360
strip_prefix = " UPDATE_ME"
380
361
)
381
362
382
- load(" @bazel_diff //:repositories.bzl" , " bazel_diff_dependencies" )
363
+ load(" @bazel-diff //:repositories.bzl" , " bazel_diff_dependencies" )
383
364
384
365
bazel_diff_dependencies()
385
366
386
367
load(" @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" )
388
369
389
370
maven_install(
390
371
name = " bazel_diff_maven" ,
@@ -399,7 +380,7 @@ maven_install(
399
380
Now you can simply run ` bazel-diff ` from your project:
400
381
401
382
``` terminal
402
- bazel run @bazel_diff// :bazel-diff -- bazel-diff -h
383
+ bazel run @bazel-diff//cli :bazel-diff -- bazel-diff -h
403
384
```
404
385
405
386
## Learn More
0 commit comments