Index: visual_studio/NativeClientVSAddIn/create_package.py |
diff --git a/visual_studio/NativeClientVSAddIn/create_package.py b/visual_studio/NativeClientVSAddIn/create_package.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1eab99da8c0e1cdf586cf104fccdaad46841c443 |
--- /dev/null |
+++ b/visual_studio/NativeClientVSAddIn/create_package.py |
@@ -0,0 +1,44 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+"""Takes the output of the build step and zips the distributable package. |
+ |
+This script assumes the build script has been run to compile the add-in. |
+It zips up all files required for the add-in installation and places the |
+result in out/NativeClientVSAddin.zip |
+""" |
+ |
+import glob |
binji
2012/07/17 17:38:55
nit: can remove, not used anymore
|
+import os |
+import shutil |
binji
2012/07/17 17:38:55
same here
|
+import zipfile |
+ |
+# Root output directory |
+BUILD_OUTPUT_DIRECTORY = "../../out/NativeClientVSAddIn/" |
+ |
+# Directory containing static installer resources |
+RESOURCE_DIRECTORY = "./InstallerResources" |
+ |
+# Directory that contains the build assemblies |
+ASSEMBLY_DIRECTORY = os.path.join(BUILD_OUTPUT_DIRECTORY, "Debug") |
+ |
+# Base name of the final zip file |
+OUTPUT_NAME = os.path.join(BUILD_OUTPUT_DIRECTORY, "NativeClientVSAddIn.zip") |
+ |
+# List of paths to files to include in the zip file |
+FILE_LIST = [ |
binji
2012/07/17 17:38:55
Nice, a lot easier to read now
|
+ os.path.join(RESOURCE_DIRECTORY, 'NativeClientVSAddIn.AddIn'), |
+ os.path.join(RESOURCE_DIRECTORY, 'install.py'), |
+ os.path.join(ASSEMBLY_DIRECTORY, 'NativeClientVSAddIn.dll')] |
+ |
+def main(): |
+ # Zip the package |
+ out_file = zipfile.ZipFile(OUTPUT_NAME, 'w') |
+ for file_path in FILE_LIST: |
+ out_file.write(file_path, os.path.basename(file_path), zipfile.ZIP_DEFLATED) |
+ out_file.close() |
+ |
+if __name__ == '__main__': |
+ main() |