|
|
@ -24,17 +24,19 @@ def FindGoogleJavaFormat():
|
|
|
|
# Make relative to solution root if not an absolute path.
|
|
|
|
# Make relative to solution root if not an absolute path.
|
|
|
|
return os.path.join(primary_solution_path, override)
|
|
|
|
return os.path.join(primary_solution_path, override)
|
|
|
|
|
|
|
|
|
|
|
|
path = os.path.join(primary_solution_path, 'third_party',
|
|
|
|
bin_path = os.path.join(primary_solution_path, 'third_party',
|
|
|
|
'google-java-format', 'google-java-format')
|
|
|
|
'google-java-format', 'google-java-format')
|
|
|
|
|
|
|
|
cipd_path = os.path.join(primary_solution_path, 'third_party',
|
|
|
|
|
|
|
|
'google-java-format', 'cipd',
|
|
|
|
|
|
|
|
'google-java-format.jar')
|
|
|
|
# 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.
|
|
|
|
# TODO(b/345761161): Remove old os.path.exists(path + '.jar') check,
|
|
|
|
# TODO(b/345761161): Remove old os.path.exists(path + '.jar') check,
|
|
|
|
# when third_party/google-java-format
|
|
|
|
# when third_party/google-java-format
|
|
|
|
# -> third_party/google-java-format/cipd is fully rolled out.
|
|
|
|
# -> third_party/google-java-format/cipd is fully rolled out.
|
|
|
|
if os.path.exists(path) and (
|
|
|
|
if os.path.exists(bin_path) and (os.path.exists(bin_path + '.jar')
|
|
|
|
os.path.exists(path + '.jar')
|
|
|
|
or os.path.exists(cipd_path)):
|
|
|
|
or os.path.exists(os.path.join(path, 'cipd') + '.jar')):
|
|
|
|
return bin_path
|
|
|
|
return path
|
|
|
|
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|