Bug 1259782 - Define zip archive path prefix argument; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Fri, 22 Apr 2016 11:37:14 -0700
changeset 355485 51b9c8ba360e5b0bf9248f1213acd3c7a6506208
parent 355480 4fdd6d4ea6d5893a2833da45015d52ddc831ec3d
child 355486 5da38fad49f8010159036fc12a557f0603ba1da0
child 355520 598cc6f50777408b54e31d25c38af78eb1e390df
child 355521 ff6cd3077799aa6b693e93be5462d67152435708
push id16303
push usergszorc@mozilla.com
push dateFri, 22 Apr 2016 18:37:50 +0000
reviewersted
bugs1259782
milestone48.0a1
Bug 1259782 - Define zip archive path prefix argument; r?ted To support generating zip archives with more flexibility. MozReview-Commit-ID: LmAgAXUfn3x
build/docs/toolchains.rst
build/windows_toolchain.py
--- a/build/docs/toolchains.rst
+++ b/build/docs/toolchains.rst
@@ -43,19 +43,22 @@ Be sure to follow these install instruct
 1. Choose a ``Custom`` installation and click ``Next``
 2. Select ``Programming Languages`` -> ``Visual C++`` (make sure all sub items are
    selected)
 3. Under ``Windows and Web Development`` uncheck everything except
    ``Universal Windows App Development Tools`` and the items under it
    (should be ``Tools (1.2)...`` and the ``Windows 10 SDK``).
 
 Once Visual Studio 2015 Community has been installed, from a checkout
-of mozilla-central, run the following to produce a ZIP archive::
+of mozilla-central, run something like the following to produce a ZIP
+archive::
 
-   $ ./mach python build/windows_toolchain.py create-zip vs2015.zip
+   $ ./mach python build/windows_toolchain.py create-zip vs2015u2
+
+The produced archive will be the argument to ``create-zip`` + ``.zip``.
 
 Firefox for Android with Gradle
 ===============================
 
 To build Firefox for Android with Gradle in automation, archives
 containing both the Gradle executable and a Maven repository
 comprising the exact build dependencies are produced and uploaded to
 an internal Mozilla server.  The build automation will download,
--- a/build/windows_toolchain.py
+++ b/build/windows_toolchain.py
@@ -232,23 +232,23 @@ def write_zip(zip_path, prefix=None):
             sha256_path = mozpath.join(prefix, sha256_path)
 
         zip.add(sdk_path, SDK_RELEASE.encode('utf-8'))
         zip.add(sha256_path, sha256_manifest)
 
 
 if __name__ == '__main__':
     if len(sys.argv) != 3:
-        print('usage: %s create-zip <filename.zip>' % sys.argv[0])
+        print('usage: %s create-zip <path-prefix>' % sys.argv[0])
         sys.exit(1)
 
     assert sys.argv[1] == 'create-zip'
-    destzip = sys.argv[2]
-    # TODO make prefix a CLI argument
-    write_zip(destzip, prefix='vs2015u1')
+    prefix = os.path.basename(sys.argv[2])
+    destzip = '%s.zip' % sys.argv[2]
+    write_zip(destzip, prefix=prefix)
 
     sha1 = hashlib.sha1()
     sha256 = hashlib.sha256()
     sha512 = hashlib.sha512()
 
     with open(destzip, 'rb') as fh:
         data = fh.read()
         sha1.update(data)