OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import shutil |
| 6 import os |
| 7 |
| 8 prefixes = ["../third_party/WebKit/Source/WebCore/platform/graphics/chromium", |
| 9 "../third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc"
, |
| 10 "../third_party/WebKit/Source/WebKit/chromium/tests"] |
| 11 |
| 12 def Copy(name): |
| 13 src = name |
| 14 dst = name |
| 15 if name.startswith("stubs"): |
| 16 return |
| 17 if name == "test/RunAllTests.cpp": |
| 18 return |
| 19 if name.startswith("test/"): |
| 20 src = src[5:] |
| 21 fullsrc = "" |
| 22 for prefix in prefixes: |
| 23 candidate = "%s/%s" % (prefix, src) |
| 24 if os.path.exists(candidate): |
| 25 fullsrc = candidate |
| 26 break |
| 27 if fullsrc == "": |
| 28 print "could not find %s to copy" % name |
| 29 return |
| 30 shutil.copyfile(fullsrc, dst) |
| 31 print "copying from %s to %s" % (fullsrc, dst) |
| 32 |
| 33 def Readfile(gypfile): |
| 34 cc_gyp = open(gypfile, "r") |
| 35 obj = eval(cc_gyp.read()) |
| 36 cc_gyp.close() |
| 37 |
| 38 return obj |
| 39 |
| 40 def Main(): |
| 41 files = Readfile("cc.gyp")['variables']['cc_source_files'] |
| 42 for f in files: |
| 43 Copy(f) |
| 44 |
| 45 files = Readfile("cc_tests.gyp")['variables']['cc_tests_source_files'] |
| 46 for f in files: |
| 47 Copy(f) |
| 48 |
| 49 if __name__ == '__main__': |
| 50 import sys |
| 51 os.chdir(os.path.dirname(__file__)) |
| 52 sys.exit(Main()) |
OLD | NEW |