Bug 1406572 - Install Proguard JAR as part of |mach bootstrap|. r=rillian
authorNick Alexander <nalexander@mozilla.com>
Tue, 17 Oct 2017 15:48:32 -0700
changeset 681969 31549ab3b6d662d84761c2a260cd236a5809c8ac
parent 681968 8a9df775b8aeb85add5530cf71541e7220b6b83d
child 688855 832712ec8cb0b24e2d641b20c772b3ea56b48f4c
push id84961
push usernalexander@mozilla.com
push dateTue, 17 Oct 2017 23:01:29 +0000
reviewersrillian
bugs1406572
milestone58.0a1
Bug 1406572 - Install Proguard JAR as part of |mach bootstrap|. r=rillian I think we're approaching an inflection point for the bootstrapper, one where it no longer is possible to bootstrap without a source checkout. For now, however, let's just do the simplest thing and install the Proguard JAR along the happy path. MozReview-Commit-ID: xUY37eE6oR
python/mozboot/mozboot/base.py
python/mozboot/mozboot/bootstrap.py
python/mozboot/mozboot/linux_common.py
python/mozboot/mozboot/mozillabuild.py
python/mozboot/mozboot/windows.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -254,17 +254,25 @@ class BaseBootstrapper(object):
     def ensure_stylo_packages(self, state_dir, checkout_root):
         '''
         Install any necessary packages needed for Stylo development.
         '''
         raise NotImplementedError(
             '%s does not yet implement ensure_stylo_packages()'
             % __name__)
 
-    def install_tooltool_clang_package(self, state_dir, checkout_root, toolchain_job):
+    def ensure_proguard_packages(self, state_dir, checkout_root):
+        '''
+        Install any necessary packages that provide the Proguard JAR.
+
+        Only required to build mobile/android.
+        '''
+        self.install_toolchain_artifact(state_dir, checkout_root, 'proguard-jar')
+
+    def install_toolchain_artifact(self, state_dir, checkout_root, toolchain_job):
         mach_binary = os.path.join(checkout_root, 'mach')
         mach_binary = os.path.abspath(mach_binary)
         if not os.path.exists(mach_binary):
             raise ValueError("mach not found at %s" % mach_binary)
 
         # If Python can't figure out what its own executable is, there's little
         # chance we're going to be able to execute mach on its own, particularly
         # on Windows.
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -365,16 +365,19 @@ class Bootstrapper(object):
 
             if not have_clone:
                 print(STYLO_REQUIRES_CLONE)
                 sys.exit(1)
 
             self.instance.state_dir = state_dir
             self.instance.ensure_stylo_packages(state_dir, checkout_root)
 
+            if 'mobile_android' in application:
+                self.instance.ensure_proguard_packages(state_dir, checkout_root)
+
         print(self.finished % name)
         if not (self.instance.which('rustc') and self.instance._parse_version('rustc') >= MODERN_RUST_VERSION):
             print("To build %s, please restart the shell (Start a new terminal window)" % name)
 
         # Like 'suggest_browser_mozconfig' or 'suggest_mobile_android_mozconfig'.
         getattr(self.instance, 'suggest_%s_mozconfig' % application)()
 
 
--- a/python/mozboot/mozboot/linux_common.py
+++ b/python/mozboot/mozboot/linux_common.py
@@ -6,9 +6,9 @@
 # needed to install Stylo dependencies.  This class must come before
 # BaseBootstrapper in the inheritance list.
 class StyloInstall(object):
     def __init__(self, **kwargs):
         pass
 
     def ensure_stylo_packages(self, state_dir, checkout_root):
         import stylo
-        self.install_tooltool_clang_package(state_dir, checkout_root, stylo.LINUX)
+        self.install_toolchain_artifact(state_dir, checkout_root, stylo.LINUX)
--- a/python/mozboot/mozboot/mozillabuild.py
+++ b/python/mozboot/mozboot/mozillabuild.py
@@ -40,17 +40,17 @@ class MozillaBuildBootstrapper(BaseBoots
     def install_mobile_android_packages(self):
         pass
 
     def install_mobile_android_artifact_mode_packages(self):
         pass
 
     def ensure_stylo_packages(self, state_dir, checkout_root):
         import stylo
-        self.install_tooltool_clang_package(state_dir, checkout_root, stylo.WINDOWS)
+        self.install_toolchain_artifact(state_dir, checkout_root, stylo.WINDOWS)
 
     def _update_package_manager(self):
         pass
 
     def run(self, command):
         subprocess.check_call(command, stdin=sys.stdin)
 
     def pip_install(self, *packages):
--- a/python/mozboot/mozboot/windows.py
+++ b/python/mozboot/mozboot/windows.py
@@ -65,17 +65,17 @@ class WindowsBootstrapper(BaseBootstrapp
     def install_mobile_android_packages(self):
         raise NotImplementedError('We do not support building Android on Windows. Sorry!')
 
     def install_mobile_android_artifact_mode_packages(self):
         raise NotImplementedError('We do not support building Android on Windows. Sorry!')
 
     def ensure_stylo_packages(self, state_dir, checkout_root):
         import stylo
-        self.install_tooltool_clang_package(state_dir, checkout_root, stylo.WINDOWS)
+        self.install_toolchain_artifact(state_dir, checkout_root, stylo.WINDOWS)
 
     def _update_package_manager(self):
         self.pacman_update()
 
     def run(self, command):
         subprocess.check_call(command, stdin=sys.stdin)
 
     def pacman_update(self):