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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: infra/bots/recipe_modules/flavor/api.py
diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py
index 83a3484bf7537a694d8aee846ffc91ad310144e5..b213647ae9251e332678d96f43a3a513a7951bdc 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
@@ -135,6 +137,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
self._copy_skps()
self._copy_images()
+ self._copy_svgs()
def cleanup_steps(self):
return self._f.cleanup_steps()
@@ -211,3 +214,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
« 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