Index: cc/copyfiles.py |
diff --git a/cc/copyfiles.py b/cc/copyfiles.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2bb623cb256e18f6c36ab8b75783c07784e7eb26 |
--- /dev/null |
+++ b/cc/copyfiles.py |
@@ -0,0 +1,52 @@ |
+# Copyright (c) 2012 Google Inc. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import shutil |
+import os |
+ |
+prefixes = ["../third_party/WebKit/Source/WebCore/platform/graphics/chromium", |
+ "../third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc", |
+ "../third_party/WebKit/Source/WebKit/chromium/tests"] |
+ |
+def Copy(name): |
+ src = name |
+ dst = name |
+ if name.startswith("stubs"): |
+ return |
+ if name == "test/RunAllTests.cpp": |
+ return |
+ if name.startswith("test/"): |
+ src = src[5:] |
+ fullsrc = "" |
+ for prefix in prefixes: |
+ candidate = "%s/%s" % (prefix, src) |
+ if os.path.exists(candidate): |
+ fullsrc = candidate |
+ break |
+ if fullsrc == "": |
+ print "could not find %s to copy" % name |
+ return |
+ shutil.copyfile(fullsrc, dst) |
+ print "copying from %s to %s" % (fullsrc, dst) |
+ |
+def Readfile(gypfile): |
+ cc_gyp = open(gypfile, "r") |
+ obj = eval(cc_gyp.read()) |
+ cc_gyp.close() |
+ |
+ return obj |
+ |
+def Main(): |
+ files = Readfile("cc.gyp")['variables']['cc_source_files'] |
+ for f in files: |
+ Copy(f) |
+ |
+ files = Readfile("cc_tests.gyp")['variables']['cc_tests_source_files'] |
+ for f in files: |
+ Copy(f) |
+ |
+if __name__ == '__main__': |
+ import sys |
+ os.chdir(os.path.dirname(__file__)) |
+ sys.exit(Main()) |