Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: visual_studio/NativeClientVSAddIn/create_package.py

Issue 10790023: VS-Addin Build/Test/Install scripts (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()

Powered by Google App Engine
This is Rietveld 408576698