This change replaces the series of VS build solutions and one-off Xcode workspace/projects that had to constantly be kept in sync with each other with a single CMake-based build system. This new system has a single build authoring mechanism (CMakeLists.txt) that describes each logical sub-project of the entire project. Builds in VS2017, Xcode, VS NMake, and unix make have been confirmed as working. Automated continuous integration of this new build system is now turned-on, meaning that once this change goes live, you'll need to update your client view of the project. At a minimum, you'll need to run: git submodule update && git submodule init once this change is pulled into your branch. For those not entirely familiar with CMake, you can use https://cmake.org/Wiki/CMake as a good starting point for how to get up and running.
Related work items: #13953155, #13953165
Sample output:
>MakeXplat.exe
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
Usage:
------
MakeXplat.exe <command> [options]
Valid commands:
---------------
-? -- Displays this help text.
-pack -- Create a new package from files on disk
-unpack -- Create a new package from files on disk
For help with a specific command, enter MakeXplat.exe <command> --?
>MakeXplat.exe -?
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
Usage:
------
MakeXplat.exe <command> [options]
Valid commands:
---------------
-? -- Displays this help text.
-pack -- Create a new package from files on disk
-unpack -- Create a new package from files on disk
For help with a specific command, enter MakeXplat.exe <command> --?
>MakeXplat.exe -unpack
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
MakeXplat.exe: error : Missing required options. Use '-?' option for more details.
>MakeXplat.exe -unpack -?
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
Usage:
------
MakeXplat.exe -upack --p <package> --d <directory> [options]
Description:
------------
Extracts all files within an app package at the <input pakcage name> to the
specified <output directory>. The output has the same directory structure
as the package.
Options:
--------
-? : Displays this help text.
-d : REQUIRED, specify output directory name.
-mv : Skips manifest validation. By default manifest validation is enabled.
-p : REQUIRED, specify input package name.
-pfn : Unpacks all files to a subdirectory under the specified output path, named after the package full name.
-sv : Skips signature validation. By default signature validation is enabled.
>MakeXplat.exe -pack
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
MakeXplat.exe: error : Missing required options. Use '-?' option for more details.
>MakeXplat.exe -pack -?
Microsoft (R) MakeXplat.exe Tool version
Copyright (C) 2017 Microsoft. All rights reserved.
Usage:
------
MakeXplat.exe -pack --p <package> --c <certificate> --d <directory> [options]
Description:
------------
Creates an appx package at output <package> name by adding all files from
content <directory> (including subfolders), and signs the package using
the specified <certificate>. You must include a valid app package manifest
named AppxManifest.xml in the content directory if you do not specify the
--nmv option.
Options:
--------
-? : Displays this help text.
-c : REQUIRED, specify input certificate name.
-d : REQUIRED, specify input directory name.
-mv : Skips manifest validation. By default manifest validation is enabled.
-p : REQUIRED, specify output package file name.
-sv : Skips signature validation. By default signature validation is enabled.
>
Related work items: #13953773
TLDR; we don't need to hold on to the state w.r.t. the 2 maps involving the central directory and the file repository. So we put those on the stack during construction of the ZipObject instead.
This patch also makes debugging on CHK/DEBUG builds MUCH easier by putting a debug assert in the path of these throws. Also, this makes the code more readable as exceptions are behind an Assert macro (which always throws the specified exception code with the associated message, but does so in a single line for readability).