Bug 1151005 - Show notifications when the 'install' and 'package' mach commands complete r=gps
authortravis <travis@browser.html>
Fri, 03 Apr 2015 14:08:00 -0500
changeset 257924 be5a20e40b56c40aaba55d935bb5f57f6af4fe38
parent 257923 82540c5ea5d517b76fccd551a9e2dc21c8d1290d
child 257925 e4132183a4fa6d1f0b3d36a9f1377aa098bc66a0
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1151005
milestone40.0a1
Bug 1151005 - Show notifications when the 'install' and 'package' mach commands complete r=gps
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -415,18 +415,17 @@ class Build(MachCommandBase):
         ccache_end = monitor.ccache_stats()
 
         if ccache_start and ccache_end:
             ccache_diff = ccache_end - ccache_start
             if ccache_diff:
                 self.log(logging.INFO, 'ccache',
                          {'msg': ccache_diff.hit_rate_message()}, "{msg}")
 
-        moz_nospam = os.environ.get('MOZ_NOSPAM')
-        if monitor.elapsed > 300 and not moz_nospam:
+        if monitor.elapsed > 300:
             # Display a notification when the build completes.
             self.notify('Build complete')
 
         if status:
             return status
 
         long_build = monitor.elapsed > 600
 
@@ -818,26 +817,32 @@ class ClangCommands(MachCommandBase):
 
 @CommandProvider
 class Package(MachCommandBase):
     """Package the built product for distribution."""
 
     @Command('package', category='post-build',
         description='Package the built product for distribution as an APK, DMG, etc.')
     def package(self):
-        return self._run_make(directory=".", target='package', ensure_exit_code=False)
+        ret = self._run_make(directory=".", target='package', ensure_exit_code=False)
+        if ret == 0:
+            self.notify('Packaging complete')
+        return ret
 
 @CommandProvider
 class Install(MachCommandBase):
     """Install a package."""
 
     @Command('install', category='post-build',
         description='Install the package on the machine, or on a device.')
     def install(self):
-        return self._run_make(directory=".", target='install', ensure_exit_code=False)
+        ret = self._run_make(directory=".", target='install', ensure_exit_code=False)
+        if ret == 0:
+            self.notify('Install complete')
+        return ret
 
 @CommandProvider
 class RunProgram(MachCommandBase):
     """Run the compiled program."""
 
     prog_group = 'the compiled program'
 
     @Command('run', category='post-build',