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

Side by Side Diff: infra/bots/recipe_modules/flavor/api.py

Issue 2231943002: Use SVGs CIPD package and use SVG as a DM source (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Address comment Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 # pylint: disable=W0201 6 # pylint: disable=W0201
7 7
8 8
9 from recipe_engine import recipe_api 9 from recipe_engine import recipe_api
10 10
11 from . import android_flavor 11 from . import android_flavor
12 from . import cmake_flavor 12 from . import cmake_flavor
13 from . import coverage_flavor 13 from . import coverage_flavor
14 from . import default_flavor 14 from . import default_flavor
15 from . import gn_flavor 15 from . import gn_flavor
16 from . import ios_flavor 16 from . import ios_flavor
17 from . import pdfium_flavor 17 from . import pdfium_flavor
18 from . import valgrind_flavor 18 from . import valgrind_flavor
19 from . import xsan_flavor 19 from . import xsan_flavor
20 20
21 21
22 TEST_EXPECTED_SKP_VERSION = '42' 22 TEST_EXPECTED_SKP_VERSION = '42'
23 TEST_EXPECTED_SVG_VERSION = '42'
23 TEST_EXPECTED_SK_IMAGE_VERSION = '42' 24 TEST_EXPECTED_SK_IMAGE_VERSION = '42'
24 25
25 VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' 26 VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION'
26 VERSION_FILE_SKP = 'SKP_VERSION' 27 VERSION_FILE_SKP = 'SKP_VERSION'
28 VERSION_FILE_SVG = 'SVG_VERSION'
27 29
28 VERSION_NONE = -1 30 VERSION_NONE = -1
29 31
30 32
31 def is_android(builder_cfg): 33 def is_android(builder_cfg):
32 """Determine whether the given builder is an Android builder.""" 34 """Determine whether the given builder is an Android builder."""
33 return ('Android' in builder_cfg.get('extra_config', '') or 35 return ('Android' in builder_cfg.get('extra_config', '') or
34 builder_cfg.get('os') == 'Android') 36 builder_cfg.get('os') == 'Android')
35 37
36 38
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 self.device_dirs = self._f.device_dirs 130 self.device_dirs = self._f.device_dirs
129 131
130 # TODO(borenet): Only copy files which have changed. 132 # TODO(borenet): Only copy files which have changed.
131 # Resources 133 # Resources
132 self.copy_directory_contents_to_device( 134 self.copy_directory_contents_to_device(
133 self.m.vars.resource_dir, 135 self.m.vars.resource_dir,
134 self.device_dirs.resource_dir) 136 self.device_dirs.resource_dir)
135 137
136 self._copy_skps() 138 self._copy_skps()
137 self._copy_images() 139 self._copy_images()
140 self._copy_svgs()
138 141
139 def cleanup_steps(self): 142 def cleanup_steps(self):
140 return self._f.cleanup_steps() 143 return self._f.cleanup_steps()
141 144
142 def _copy_dir(self, host_version, version_file, tmp_dir, 145 def _copy_dir(self, host_version, version_file, tmp_dir,
143 host_path, device_path, test_expected_version, 146 host_path, device_path, test_expected_version,
144 test_actual_version): 147 test_actual_version):
145 actual_version_file = self.m.path.join(tmp_dir, version_file) 148 actual_version_file = self.m.path.join(tmp_dir, version_file)
146 # Copy to device. 149 # Copy to device.
147 device_version_file = self.device_path_join( 150 device_version_file = self.device_path_join(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 version, 207 version,
205 VERSION_FILE_SKP, 208 VERSION_FILE_SKP,
206 self.m.vars.tmp_dir, 209 self.m.vars.tmp_dir,
207 self.m.vars.local_skp_dir, 210 self.m.vars.local_skp_dir,
208 self.device_dirs.skp_dir, 211 self.device_dirs.skp_dir,
209 test_expected_version=self.m.properties.get( 212 test_expected_version=self.m.properties.get(
210 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION), 213 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION),
211 test_actual_version=self.m.properties.get( 214 test_actual_version=self.m.properties.get(
212 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)) 215 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION))
213 return version 216 return version
217
218 def _copy_svgs(self):
219 """Download and copy the SVGs if needed."""
220 version_file = self.m.vars.infrabots_dir.join(
221 'assets', 'svg', 'VERSION')
222 test_data = self.m.properties.get(
223 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)
224 version = self.m.run.readfile(
225 version_file,
226 name='Get downloaded SVG VERSION',
227 test_data=test_data).rstrip()
228 self.m.run.writefile(
229 self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SVG),
230 version)
231 self._copy_dir(
232 version,
233 VERSION_FILE_SVG,
234 self.m.vars.tmp_dir,
235 self.m.vars.local_svg_dir,
236 self.device_dirs.svg_dir,
237 test_expected_version=self.m.properties.get(
238 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION),
239 test_actual_version=self.m.properties.get(
240 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION))
241 return version
OLDNEW
« no previous file with comments | « infra/bots/recipe_modules/flavor/android_flavor.py ('k') | infra/bots/recipe_modules/flavor/default_flavor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698