5 Commits

Author SHA1 Message Date
Aleksei Khoroshilov
c81622f6bf Fix google-java-format exec when cipd package is not available.
Bug: 458101569
Change-Id: Ifcda7d8bf044c4867e2b49a1d9d7b895b43128d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7130803
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
2025-11-07 10:21:25 -08:00
Andrew Grieve
33744dc6bc Make google-java-format easier to use for non-chromium checkouts like R8
1. Use "codereview.settings" in addition to "buildtools" as the marker
   that identifies a project root.
2. Allow the presence of any .jar file to indicate the availability of
   google-java-format.
3. Do not pass --aosp when running google-java-format

Bug: 456461246
Change-Id: Id27b3c03f592a0ed73fb7a6b4dd662707a649166
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7102758
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
2025-10-30 12:05:33 -07:00
Joanna Wang
705b8d2d85 Fix google-java-format/cipd exists check.
Bug: b/345761161
Change-Id: I3e3e7d84d962530b02a345d14ad8c15f57a49838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5606286
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2024-06-07 18:20:28 +00:00
Joanna Wang
b7b7718b47 Support new third_party/google-java-format/cipd/ path.
Bug: 345761161
Change-Id: I23d0c4eceb76706eb286fe87baaf6f93f93747eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5608492
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2024-06-07 17:16:57 +00:00
Scott Lee
a76c50e296 [depot_tools] add google_java_format.py
google_java_format.py is a simple wrapper script that finds and
executes the google-java-format binary from Chromium tree.

This CL moves the corresponding function from git_cl.py so that
the logic can be executed without git_cl.py. This is the same strcture
used in git_cl.py for running other language formatters.
- clang_format.py
- swift_format.py
- rustfmt.py
- gn.py

With this patch, google-java-format can be used to run to formatter
a java file in a chromium tree that is located in a non git checkout.

Change-Id: I5f1b845040b28c0a8f15dd2e7c48c83ce2d9df97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5525851
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
2024-05-10 18:20:09 +00:00