diff options
Diffstat (limited to 'infra/bots/recipe_modules/flavor')
-rw-r--r-- | infra/bots/recipe_modules/flavor/android_flavor.py | 1 | ||||
-rw-r--r-- | infra/bots/recipe_modules/flavor/api.py | 28 | ||||
-rw-r--r-- | infra/bots/recipe_modules/flavor/default_flavor.py | 7 | ||||
-rw-r--r-- | infra/bots/recipe_modules/flavor/ios_flavor.py | 3 |
4 files changed, 38 insertions, 1 deletions
diff --git a/infra/bots/recipe_modules/flavor/android_flavor.py b/infra/bots/recipe_modules/flavor/android_flavor.py index 85ccef3fb8..c896f058b1 100644 --- a/infra/bots/recipe_modules/flavor/android_flavor.py +++ b/infra/bots/recipe_modules/flavor/android_flavor.py @@ -267,6 +267,7 @@ class AndroidFlavorUtils(default_flavor.DefaultFlavorUtils): resource_dir=prefix + 'resources', images_dir=prefix + 'images', skp_dir=prefix + 'skp/skps', + svg_dir=prefix + 'svg/svgs', tmp_dir=prefix + 'tmp_dir') self._has_root = self.has_root() diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py index 0e8411de63..433f11b5b9 100644 --- a/infra/bots/recipe_modules/flavor/api.py +++ b/infra/bots/recipe_modules/flavor/api.py @@ -20,10 +20,12 @@ from . import xsan_flavor TEST_EXPECTED_SKP_VERSION = '42' +TEST_EXPECTED_SVG_VERSION = '42' TEST_EXPECTED_SK_IMAGE_VERSION = '42' VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' VERSION_FILE_SKP = 'SKP_VERSION' +VERSION_FILE_SVG = 'SVG_VERSION' VERSION_NONE = -1 @@ -133,6 +135,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi): self._copy_skps() self._copy_images() + self._copy_svgs() def cleanup_steps(self): return self._f.cleanup_steps() @@ -209,3 +212,28 @@ class SkiaFlavorApi(recipe_api.RecipeApi): test_actual_version=self.m.properties.get( 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)) return version + + def _copy_svgs(self): + """Download and copy the SVGs if needed.""" + version_file = self.m.vars.infrabots_dir.join( + 'assets', 'svg', 'VERSION') + test_data = self.m.properties.get( + 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION) + version = self.m.run.readfile( + version_file, + name='Get downloaded SVG VERSION', + test_data=test_data).rstrip() + self.m.run.writefile( + self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SVG), + version) + self._copy_dir( + version, + VERSION_FILE_SVG, + self.m.vars.tmp_dir, + self.m.vars.local_svg_dir, + self.device_dirs.svg_dir, + test_expected_version=self.m.properties.get( + 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION), + test_actual_version=self.m.properties.get( + 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)) + return version diff --git a/infra/bots/recipe_modules/flavor/default_flavor.py b/infra/bots/recipe_modules/flavor/default_flavor.py index 3670457474..80a0a171df 100644 --- a/infra/bots/recipe_modules/flavor/default_flavor.py +++ b/infra/bots/recipe_modules/flavor/default_flavor.py @@ -22,12 +22,14 @@ class DeviceDirs(object): resource_dir, images_dir, skp_dir, + svg_dir, tmp_dir): self._dm_dir = dm_dir self._perf_data_dir = perf_data_dir self._resource_dir = resource_dir self._images_dir = images_dir self._skp_dir = skp_dir + self._svg_dir = svg_dir self._tmp_dir = tmp_dir @property @@ -53,6 +55,10 @@ class DeviceDirs(object): return self._skp_dir @property + def svg_dir(self): + return self._svg_dir + + @property def tmp_dir(self): return self._tmp_dir @@ -220,6 +226,7 @@ class DefaultFlavorUtils(object): resource_dir=self.m.vars.resource_dir, images_dir=self.m.vars.images_dir, skp_dir=self.m.vars.local_skp_dir, + svg_dir=self.m.vars.local_svg_dir, tmp_dir=self.m.vars.tmp_dir) def cleanup_steps(self): diff --git a/infra/bots/recipe_modules/flavor/ios_flavor.py b/infra/bots/recipe_modules/flavor/ios_flavor.py index 7708d5dccd..5d33d1c4df 100644 --- a/infra/bots/recipe_modules/flavor/ios_flavor.py +++ b/infra/bots/recipe_modules/flavor/ios_flavor.py @@ -119,6 +119,7 @@ class iOSFlavorUtils(default_flavor.DefaultFlavorUtils): resource_dir=prefix + 'resources', images_dir=prefix + 'images', skp_dir=prefix + 'skp/skps', + svg_dir=prefix + 'svg/svgs', tmp_dir=prefix + 'tmp_dir') self.m.run( @@ -130,7 +131,7 @@ class iOSFlavorUtils(default_flavor.DefaultFlavorUtils): def cleanup_steps(self): """Run any device-specific cleanup steps.""" - if self.m.vars.role in (self.m.builder_name_schema.BUILDER_ROLE_TEST, + if self.m.vars.role in (self.m.builder_name_schema.BUILDER_ROLE_TEST, self.m.builder_name_schema.BUILDER_ROLE_PERF): self.m.run( self.m.step, |