OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2015 Google Inc. | 3 # Copyright 2015 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 # This script will update Skia's dependencies as necessary and run | 8 # This script will update Skia's dependencies as necessary and run |
9 # gyp if needed. | 9 # gyp if needed. |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 def listfiles(folder, matchfilter): | 121 def listfiles(folder, matchfilter): |
122 for root, folders, files in os.walk(folder): | 122 for root, folders, files in os.walk(folder): |
123 for filename in files: | 123 for filename in files: |
124 if fnmatch.fnmatch(filename, matchfilter): | 124 if fnmatch.fnmatch(filename, matchfilter): |
125 yield os.path.join(root, filename) | 125 yield os.path.join(root, filename) |
126 | 126 |
127 for filename in sorted(listfiles('gyp', '*')): | 127 for filename in sorted(listfiles('gyp', '*')): |
128 with open(filename, 'r') as f: | 128 with open(filename, 'r') as f: |
129 hasher.update(f.read()) | 129 hasher.update(f.read()) |
130 | 130 |
131 for dir in ['bench', 'gm', 'tests']: | 131 find_dirs = [ |
| 132 'bench', |
| 133 'fuzz', |
| 134 'gm', |
| 135 'tests', |
| 136 'third_party/externals/icu/source/common', |
| 137 'third_party/externals/nanomsg/src', |
| 138 'third_party/externals/sfntly/sfntly', |
| 139 'third_party/externals/shaderc2', |
| 140 'tools/VisualBench', |
| 141 'tools/gpu', |
| 142 'tools/kilobench', |
| 143 'tools/skiaserve', |
| 144 'tools/skiaserve/urlhandlers', |
| 145 'tools/vulkan', |
| 146 ] |
| 147 |
| 148 for dir in find_dirs: |
132 for filename in sorted(listfiles(dir, '*.c*')): | 149 for filename in sorted(listfiles(dir, '*.c*')): |
133 hasher.update(filename + '\n') | 150 hasher.update(filename + '\n') |
134 | 151 |
135 gyp_hash = hasher.hexdigest() | 152 gyp_hash = hasher.hexdigest() |
136 | 153 |
137 def cat_if_exists(path): | 154 def cat_if_exists(path): |
138 if os.path.exists(path): | 155 if os.path.exists(path): |
139 with open(path, 'r') as f: | 156 with open(path, 'r') as f: |
140 return f.read() | 157 return f.read() |
141 return '' | 158 return '' |
142 | 159 |
143 if cat_if_exists(hash_path).strip() != gyp_hash: | 160 if cat_if_exists(hash_path).strip() != gyp_hash: |
144 env = os.environ.copy() | 161 env = os.environ.copy() |
145 if skia_out: | 162 if skia_out: |
146 env['SKIA_OUT'] = skia_out | 163 env['SKIA_OUT'] = skia_out |
147 subprocess.call(['python', './gyp_skia'], env=env) | 164 subprocess.call(['python', './gyp_skia'], env=env) |
148 with open(hash_path, 'w') as o: | 165 with open(hash_path, 'w') as o: |
149 o.write(gyp_hash) | 166 o.write(gyp_hash) |
OLD | NEW |