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

Unified Diff: pylib/gyp/win_tool.py

Issue 9460049: Next level of changes to get more of Chrome building (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: wip Created 8 years, 9 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
« no previous file with comments | « pylib/gyp/ninja_syntax.py ('k') | test/lib/TestCmd.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/win_tool.py
diff --git a/pylib/gyp/win_tool.py b/pylib/gyp/win_tool.py
index ba2e86bcb57bbd738a14f395ae935b27f53d5511..55cf0f12cc417fc57c7b205e496e00204e6b2ba1 100644
--- a/pylib/gyp/win_tool.py
+++ b/pylib/gyp/win_tool.py
@@ -9,8 +9,10 @@
These functions are executed via gyp-win-tool when using the ninja generator.
"""
+import json
import os
import shutil
+import subprocess
import sys
@@ -49,6 +51,43 @@ class WinTool(object):
else:
shutil.copy2(source, dest)
+ def ExecTouch(self, path):
+ """Basic touch."""
+ if os.path.exists(path):
+ os.utime(path, None)
+ else:
+ open(path, 'w').close()
+
+ def ExecQuietMidl(self, outdir, tlb, h, dlldata, iid, proxy, idl, *flags):
+ args = ['midl', '/nologo'] + list(flags) + [
+ '/out', outdir,
+ '/tlb', tlb,
+ '/h', h,
+ '/dlldata', dlldata,
+ '/iid', iid,
+ '/proxy', proxy,
+ idl]
+ popen = subprocess.Popen(args,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ out, err = popen.communicate()
+ # TODO(scottmg): Filter out the silly noise.
+ sys.stdout.write(out)
+ return popen.returncode
+
+ def ExecDealWithCygwin(self, argspath):
+ """|path| contains the arguments to a cygwin bash sub-shell in python
+ repr()'d format. Returns error code from sub-shell."""
+ build_to_base, cygdirs, args = json.loads(open(argspath, 'r').read())
+ # TODO(scottmg): Totally don't get how this setup path is supposed to
+ # work. msvs_cygwin_dirs? But never seems right.
+ args = ' '.join(a.replace('\\', '/') for a in args)
+ cmd = 'call ..\\..\\third_party\\cygwin\\setup_env.bat && ' \
+ 'cd %s && ' \
+ 'bash -c "%s"' % (build_to_base, args)
+ print "running:", cmd
+ return os.system(cmd)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
« no previous file with comments | « pylib/gyp/ninja_syntax.py ('k') | test/lib/TestCmd.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698