From c5b33d0cbb86f128b05e3a9c54d4bebdaedb3ef7 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 22 Apr 2016 11:37:14 -0700 Subject: [PATCH] Bug 1259782 - Define zip archive path prefix argument; r=ted To support generating zip archives with more flexibility. MozReview-Commit-ID: LmAgAXUfn3x --HG-- extra : rebase_source : 2b9ddbda0c3dab2a498b2fc217e728a9cfefc134 --- build/docs/toolchains.rst | 7 +++++-- build/windows_toolchain.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/docs/toolchains.rst b/build/docs/toolchains.rst index 4da346eee479..15dc16ea0b79 100644 --- a/build/docs/toolchains.rst +++ b/build/docs/toolchains.rst @@ -48,9 +48,12 @@ Be sure to follow these install instructions: (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 =============================== diff --git a/build/windows_toolchain.py b/build/windows_toolchain.py index 1ecbb8fb1cb7..578fe71568be 100644 --- a/build/windows_toolchain.py +++ b/build/windows_toolchain.py @@ -237,13 +237,13 @@ def write_zip(zip_path, prefix=None): if __name__ == '__main__': if len(sys.argv) != 3: - print('usage: %s create-zip ' % sys.argv[0]) + print('usage: %s create-zip ' % 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()