Bug 1259782 - Define zip archive path prefix argument; r=ted
authorGregory Szorc <gps@mozilla.com>
Fri, 22 Apr 2016 11:37:14 -0700
changeset 332461 67134dc3bf2bec43f6bc2685a17ff897dc8c2eef
parent 332460 fa44404d8be401240ff14ea908037b484ccf0c7d
child 332462 d6ea7c8e2449d9b34882650490383ee86b8bb164
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1259782
milestone48.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 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)