diff options
author | newt <newt@chromium.org> | 2014-10-10 14:48:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-10 21:49:11 +0000 |
commit | e0da09649369c4b65d0bedf5bc3609299a0ef5e3 (patch) | |
tree | 7121908d0d29f31668a5d34f31f6596e100021dd /chrome/chrome_android.gypi | |
parent | ff7e802c8548647f8fa6c4f4d7848f3b2b5baac2 (diff) | |
download | chromium_src-e0da09649369c4b65d0bedf5bc3609299a0ef5e3.zip chromium_src-e0da09649369c4b65d0bedf5bc3609299a0ef5e3.tar.gz chromium_src-e0da09649369c4b65d0bedf5bc3609299a0ef5e3.tar.bz2 |
Generate ChromeVersionConstants.java at build time.
This allows us to query version information (e.g. the build version,
whether it's an offical build) whether or not the native library is
loaded.
Future work: put channel information in this file too, and delete the
ChromeVersionInfo.init() method.
TBR=mmenke@chromium.org
Review URL: https://codereview.chromium.org/623403002
Cr-Commit-Position: refs/heads/master@{#299195}
Diffstat (limited to 'chrome/chrome_android.gypi')
-rw-r--r-- | chrome/chrome_android.gypi | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/chrome/chrome_android.gypi b/chrome/chrome_android.gypi index a1ec31a..f494b39 100644 --- a/chrome/chrome_android.gypi +++ b/chrome/chrome_android.gypi @@ -51,5 +51,58 @@ ], }, }, + { + 'target_name': 'chrome_version_java', + 'type': 'none', + 'variables': { + 'template_input_path': 'android/java/ChromeVersionConstants.java.version', + 'version_path': 'VERSION', + 'version_py_path': '<(DEPTH)/build/util/version.py', + 'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/chrome/browser/ChromeVersionConstants.java', + + 'conditions': [ + ['branding == "Chrome"', { + 'branding_path': 'app/theme/google_chrome/BRANDING', + }, { + 'branding_path': 'app/theme/chromium/BRANDING', + }], + ], + }, + 'direct_dependent_settings': { + 'variables': { + # Ensure that the output directory is used in the class path + # when building targets that depend on this one. + 'generated_src_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)', + ], + # Ensure dependents are rebuilt when the generated Java file changes. + 'additional_input_paths': [ + '<(output_path)', + ], + }, + }, + 'actions': [ + { + 'action_name': 'chrome_version_java_template', + 'inputs': [ + '<(template_input_path)', + '<(version_path)', + '<(branding_path)', + '<(version_py_path)', + ], + 'outputs': [ + '<(output_path)', + ], + 'action': [ + 'python', + '<(version_py_path)', + '-f', '<(version_path)', + '-f', '<(branding_path)', + '<(template_input_path)', + '<(output_path)', + ], + }, + ], + }, ], } |