Bladeren bron

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>
Joanna Wang 1 jaar geleden
bovenliggende
commit
b7b7718b47
1 gewijzigde bestanden met toevoegingen van 6 en 1 verwijderingen
  1. 6 1
      google_java_format.py

+ 6 - 1
google_java_format.py

@@ -28,7 +28,12 @@ def FindGoogleJavaFormat():
                             'google-java-format', 'google-java-format')
                             'google-java-format', 'google-java-format')
         # Check that the .jar exists, since it is conditionally downloaded via
         # Check that the .jar exists, since it is conditionally downloaded via
         # DEPS conditions.
         # DEPS conditions.
-        if os.path.exists(path) and os.path.exists(path + '.jar'):
+        # TODO(b/345761161): Remove old os.path.exists(path + '.jar') check,
+        # when third_party/google-java-format
+        #     -> third_party/google-java-format/cipd is fully rolled out.
+        if os.path.exists(path) and (
+                os.path.exists(path + '.jar')
+                or os.path.exists(os.path.join(path, 'cipd') + '.jar')):
             return path
             return path
     return None
     return None