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

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

Issue 2189713003: recipes: Add a GN flavor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: build all the things 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import json 9 import json
10 import os 10 import os
11 import re 11 import re
12 import sys 12 import sys
13 13
14 from recipe_engine import recipe_api 14 from recipe_engine import recipe_api
15 from recipe_engine import config_types 15 from recipe_engine import config_types
16 16
17 from . import android_flavor 17 from . import android_flavor
18 from . import cmake_flavor 18 from . import cmake_flavor
19 from . import coverage_flavor 19 from . import coverage_flavor
20 from . import default_flavor 20 from . import default_flavor
21 from . import fake_specs 21 from . import fake_specs
22 from . import gn_flavor
22 from . import ios_flavor 23 from . import ios_flavor
23 from . import pdfium_flavor 24 from . import pdfium_flavor
24 from . import valgrind_flavor 25 from . import valgrind_flavor
25 from . import xsan_flavor 26 from . import xsan_flavor
26 27
27 28
28 BOTO_CHROMIUM_SKIA_GM = 'chromium-skia-gm.boto' 29 BOTO_CHROMIUM_SKIA_GM = 'chromium-skia-gm.boto'
29 30
30 GS_SUBDIR_TMPL_SK_IMAGE = 'skimage/v%s' 31 GS_SUBDIR_TMPL_SK_IMAGE = 'skimage/v%s'
31 GS_SUBDIR_TMPL_SKP = 'playback_%s/skps' 32 GS_SUBDIR_TMPL_SKP = 'playback_%s/skps'
(...skipping 26 matching lines...) Expand all
58 def is_android(builder_cfg): 59 def is_android(builder_cfg):
59 """Determine whether the given builder is an Android builder.""" 60 """Determine whether the given builder is an Android builder."""
60 return ('Android' in builder_cfg.get('extra_config', '') or 61 return ('Android' in builder_cfg.get('extra_config', '') or
61 builder_cfg.get('os') == 'Android') 62 builder_cfg.get('os') == 'Android')
62 63
63 64
64 def is_cmake(builder_cfg): 65 def is_cmake(builder_cfg):
65 return 'CMake' in builder_cfg.get('extra_config', '') 66 return 'CMake' in builder_cfg.get('extra_config', '')
66 67
67 68
69 def is_gn(builder_cfg):
70 return 'GN' in builder_cfg.get('extra_config', '')
borenet 2016/07/28 14:23:27 Not sure if we should just do a equals here. We m
jcgregorio 2016/07/28 15:26:25 Done.
71
72
68 def is_ios(builder_cfg): 73 def is_ios(builder_cfg):
69 return ('iOS' in builder_cfg.get('extra_config', '') or 74 return ('iOS' in builder_cfg.get('extra_config', '') or
70 builder_cfg.get('os') == 'iOS') 75 builder_cfg.get('os') == 'iOS')
71 76
72 77
73 def is_pdfium(builder_cfg): 78 def is_pdfium(builder_cfg):
74 return 'PDFium' in builder_cfg.get('extra_config', '') 79 return 'PDFium' in builder_cfg.get('extra_config', '')
75 80
76 81
77 def is_valgrind(builder_cfg): 82 def is_valgrind(builder_cfg):
78 return 'Valgrind' in builder_cfg.get('extra_config', '') 83 return 'Valgrind' in builder_cfg.get('extra_config', '')
79 84
80 85
81 def is_xsan(builder_cfg): 86 def is_xsan(builder_cfg):
82 return ('ASAN' in builder_cfg.get('extra_config', '') or 87 return ('ASAN' in builder_cfg.get('extra_config', '') or
83 'MSAN' in builder_cfg.get('extra_config', '') or 88 'MSAN' in builder_cfg.get('extra_config', '') or
84 'TSAN' in builder_cfg.get('extra_config', '')) 89 'TSAN' in builder_cfg.get('extra_config', ''))
85 90
86 91
87 class SkiaApi(recipe_api.RecipeApi): 92 class SkiaApi(recipe_api.RecipeApi):
88 93
89 def get_flavor(self, builder_cfg): 94 def get_flavor(self, builder_cfg):
90 """Return a flavor utils object specific to the given builder.""" 95 """Return a flavor utils object specific to the given builder."""
91 if is_android(builder_cfg): 96 if is_android(builder_cfg):
92 return android_flavor.AndroidFlavorUtils(self) 97 return android_flavor.AndroidFlavorUtils(self)
93 elif is_cmake(builder_cfg): 98 elif is_cmake(builder_cfg):
94 return cmake_flavor.CMakeFlavorUtils(self) 99 return cmake_flavor.CMakeFlavorUtils(self)
100 elif is_gn(builder_cfg):
101 return gn_flavor.GNFlavorUtils(self)
95 elif is_ios(builder_cfg): 102 elif is_ios(builder_cfg):
96 return ios_flavor.iOSFlavorUtils(self) 103 return ios_flavor.iOSFlavorUtils(self)
97 elif is_pdfium(builder_cfg): 104 elif is_pdfium(builder_cfg):
98 return pdfium_flavor.PDFiumFlavorUtils(self) 105 return pdfium_flavor.PDFiumFlavorUtils(self)
99 elif is_valgrind(builder_cfg): 106 elif is_valgrind(builder_cfg):
100 return valgrind_flavor.ValgrindFlavorUtils(self) 107 return valgrind_flavor.ValgrindFlavorUtils(self)
101 elif is_xsan(builder_cfg): 108 elif is_xsan(builder_cfg):
102 return xsan_flavor.XSanFlavorUtils(self) 109 return xsan_flavor.XSanFlavorUtils(self)
103 elif builder_cfg.get('configuration') == 'Coverage': 110 elif builder_cfg.get('configuration') == 'Coverage':
104 return coverage_flavor.CoverageFlavorUtils(self) 111 return coverage_flavor.CoverageFlavorUtils(self)
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 # Don't bother to include role, which is always Test. 829 # Don't bother to include role, which is always Test.
823 # TryBots are uploaded elsewhere so they can use the same key. 830 # TryBots are uploaded elsewhere so they can use the same key.
824 blacklist = ['role', 'is_trybot'] 831 blacklist = ['role', 'is_trybot']
825 832
826 flat = [] 833 flat = []
827 for k in sorted(self.builder_cfg.keys()): 834 for k in sorted(self.builder_cfg.keys()):
828 if k not in blacklist: 835 if k not in blacklist:
829 flat.append(k) 836 flat.append(k)
830 flat.append(self.builder_cfg[k]) 837 flat.append(self.builder_cfg[k])
831 return flat 838 return flat
OLDNEW
« no previous file with comments | « no previous file | infra/bots/recipe_modules/skia/fake_specs.py » ('j') | infra/bots/recipe_modules/skia/gn_flavor.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698