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

Unified Diff: visual_studio/NativeClientVSAddIn/InstallerResources/create_ppapi_platform.py

Issue 10831030: NaCl settings and completed 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/InstallerResources/create_ppapi_platform.py
diff --git a/visual_studio/NativeClientVSAddIn/InstallerResources/create_ppapi_platform.py b/visual_studio/NativeClientVSAddIn/InstallerResources/create_ppapi_platform.py
index c238009f5b30f2b60fb032b60cedebae61d70351..fe9e028d929c6b3615e6da4bfe9f94790fb16d7b 100644
--- a/visual_studio/NativeClientVSAddIn/InstallerResources/create_ppapi_platform.py
+++ b/visual_studio/NativeClientVSAddIn/InstallerResources/create_ppapi_platform.py
@@ -17,6 +17,9 @@ import string
import xml_patch
import xml.etree.ElementTree
+
+PEPPER_PLATFORM_NAME = 'PPAPI'
+
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PLATFORM_FILES = [
@@ -137,16 +140,26 @@ def FixAttributesNamespace(tree):
elem.attrib = new_attrib
-def main():
- install_dir = os.path.expandvars(
- '%ProgramFiles(x86)%\\MSBuild\\Microsoft.Cpp\\v4.0\\Platforms')
+def CreatePPAPI(msbuild_dir):
+ """Creates the PPAPI template.
+
+ Args:
+ msbuild_dir: The path to the MSBuild installation.
+
+ Returns:
+ Nothing.
+
+ Raises:
+ Exception indicating Win32 platform was not found.
+ """
+
+ install_dir = os.path.join(msbuild_dir, 'Microsoft.Cpp\\v4.0\\Platforms')
# Note 1033 is code for the english language.
- ui_xml_dir = os.path.expandvars(
- '%ProgramFiles(x86)%\\MSBuild\\Microsoft.Cpp\\v4.0\\1033')
+ ui_xml_dir = os.path.join(msbuild_dir, 'Microsoft.Cpp\\v4.0\\1033')
win32_dir = os.path.join(install_dir, 'Win32')
- ppapi_dir = os.path.join(install_dir, 'PPAPI')
+ ppapi_dir = os.path.join(install_dir, PEPPER_PLATFORM_NAME)
patch_dir = os.path.join(SCRIPT_DIR, 'PPAPI_Patch')
if not os.path.exists(win32_dir):
@@ -176,5 +189,13 @@ def main():
os.path.join(ppapi_dir, 'Microsoft.Build.CPPTasks.PPAPI.dll'))
+def main(argv):
+ # Optionally pass in MS Build installation directory.
binji 2012/07/26 23:32:17 now that you have args, you should really add optp
tysand 2012/07/28 01:13:11 Done.
+ if len(argv) > 1:
+ msbuild_dir = argv[1]
+ else:
+ msbuild_dir = os.path.expandvars('%ProgramFiles(x86)%\\MSBuild')
+ CreatePPAPI(msbuild_dir)
+
if __name__ == '__main__':
- main()
+ main(sys.argv)

Powered by Google App Engine
This is Rietveld 408576698