Bug 1548916 - Add support for specifying a custom path for app version files. r=firefox-build-system-reviewers,mshal
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 06 May 2019 23:19:44 +0000
changeset 531612 d2d67ffc31fcaab22a60feb8394a3d01ab7ce52d
parent 531611 16545e6e556eb031b325e6012cf27419f5c56091
child 531613 4574274db3f95575dca7da08e16d6f20242fcb2a
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, mshal
bugs1548916
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548916 - Add support for specifying a custom path for app version files. r=firefox-build-system-reviewers,mshal Differential Revision: https://phabricator.services.mozilla.com/D29918
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1123,37 +1123,51 @@ def mozilla_official(official):
         return True
 
 
 set_config('MOZILLA_OFFICIAL', mozilla_official)
 set_define('MOZILLA_OFFICIAL', mozilla_official)
 add_old_configure_assignment('MOZILLA_OFFICIAL', mozilla_official)
 
 
+# Allow specifying custom paths to the version files used by the milestone() function below.
+option('--with-version-file-path',
+       nargs=1,
+       help='Specify a custom path to app version files instead of auto-detecting',
+       default=None)
+
+@depends('--with-version-file-path')
+def version_path(path):
+    return path
+
 # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
 # The logic works like this:
 # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
 # - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
 # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
-@depends(check_build_environment, build_project, '--help')
+@depends(check_build_environment, build_project, version_path, '--help')
 @imports(_from='__builtin__', _import='open')
 @imports('os')
 @imports('re')
-def milestone(build_env, build_project, _):
+def milestone(build_env, build_project, version_path, _):
     versions = []
     paths = ['config/milestone.txt']
     if build_project == 'js':
         paths = paths * 3
     else:
         paths += [
             'browser/config/version.txt',
             'browser/config/version_display.txt',
         ]
+    if version_path:
+        version_path = version_path[0]
+    else:
+        version_path = os.path.join(build_project, 'config')
     for f in ('version.txt', 'version_display.txt'):
-        f = os.path.join(build_project, 'config', f)
+        f = os.path.join(version_path, f)
         if not os.path.exists(os.path.join(build_env.topsrcdir, f)):
             break
         paths.append(f)
 
     for p in paths:
         with open(os.path.join(build_env.topsrcdir, p), 'r') as fh:
             content = fh.read().splitlines()
             if not content: