Bug 1223209 - Clean up old GeckoView library files; r=nalexander
authorJim Chen <nchen@mozilla.com>
Thu, 14 Jan 2016 18:20:02 -0500
changeset 317096 0c8cd67f497e7f08e01dff8ec32588fa0e255d75
parent 317095 3f8b80d42f00d37a6fe6a36039b1db8be75339c6
child 317097 caa765055fbcb0d43ee86e3560cee191664c0801
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1223209
milestone46.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 1223209 - Clean up old GeckoView library files; r=nalexander Right now, each incremental build produces a new set of GeckoView library files, but the previous files don't get cleaned up, and you end up with a bunch of old libraries in your objdir. This patch cleans up the old files before producing new ones.
python/mozbuild/mozbuild/action/package_geckolibs_aar.py
toolkit/mozapps/installer/upload-files.mk
--- a/python/mozbuild/mozbuild/action/package_geckolibs_aar.py
+++ b/python/mozbuild/mozbuild/action/package_geckolibs_aar.py
@@ -156,31 +156,42 @@ def main(args):
     parser.add_argument('--revision',
                         help='Revision identifier to write.')
     parser.add_argument('--topsrcdir',
                         help='Top source directory.')
     parser.add_argument('--distdir',
                         help='Distribution directory (usually $OBJDIR/dist).')
     parser.add_argument('--appname',
                         help='Application name (usually $MOZ_APP_NAME, like "fennec").')
+    parser.add_argument('--purge-old', default=False, action='store_true',
+                        help='Delete any existing output files in the output directory.')
     args = parser.parse_args(args)
 
     # An Ivy 'publication' date must be given in the form yyyyMMddHHmmss, and Mozilla buildids are in this format.
     if len(args.revision) != 14:
         raise ValueError('Revision must be in yyyyMMddHHmmss format: %s' % args.revision)
 
     paths_to_hash = []
 
     groupId='org.mozilla'
     packaging_type='aar'
     gecklibs_aar = os.path.join(args.dir, 'geckolibs-{revision}.aar').format(revision=args.revision)
     paths_to_hash.append(gecklibs_aar)
     geckoview_aar = os.path.join(args.dir, 'geckoview-{revision}.aar').format(revision=args.revision)
     paths_to_hash.append(geckoview_aar)
 
+    if args.purge_old:
+        old_output_finder = FileFinder(args.dir, find_executables=False)
+        for p, f in old_output_finder.find('geckoview-*.*'):
+            os.remove(f.path)
+        for p, f in old_output_finder.find('geckolibs-*.*'):
+            os.remove(f.path)
+        for p, f in old_output_finder.find('ivy-*.*'):
+            os.remove(f.path)
+
     package_geckolibs_aar(args.topsrcdir, args.distdir, args.appname, gecklibs_aar)
     package_geckoview_aar(args.topsrcdir, args.distdir, args.appname, geckoview_aar)
 
     geckolibs_pom_path = os.path.join(args.dir, 'geckolibs-{revision}.pom').format(revision=args.revision)
     paths_to_hash.append(geckolibs_pom_path)
     geckolibs_pom = MAVEN_POM_TEMPLATE.format(
             groupId=groupId,
             artifactId='geckolibs',
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -379,16 +379,17 @@ UPLOAD_EXTRA_FILES += \
 
 INNER_MAKE_GECKOLIBS_AAR= \
   $(PYTHON) -m mozbuild.action.package_geckolibs_aar \
     --verbose \
     --revision $(geckoaar-revision) \
     --topsrcdir '$(topsrcdir)' \
     --distdir '$(ABS_DIST)' \
     --appname '$(MOZ_APP_NAME)' \
+    --purge-old \
     '$(ABS_DIST)'
 else
 INNER_MAKE_GECKOLIBS_AAR=echo 'Android geckolibs.aar packaging requires packaging geckoview'
 endif # MOZ_DISABLE_GECKOVIEW
 else
 INNER_MAKE_GECKOLIBS_AAR=echo 'Android geckolibs.aar packaging is disabled'
 endif # MOZ_ANDROID_GECKOLIBS_AAR