Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2a5053f

Browse files
authored
[fuchsia] Adds --targets arg for build_fuchsia_artifacts.py (#19109)
The Fuchsia artifact builder didn't allow the end user to add more packages to build for Fuchsia. The current default is building only the platform-specific packages; but packages like `flutter/shell/common:shell_tests` are also defined for Fuchsia but not compiled by default. This change makes it less of a hassle to compile such packages.
1 parent 1913040 commit 2a5053f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tools/fuchsia/build_fuchsia_artifacts.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ def GetRunnerTarget(runner_type, product, aot):
215215
return base + target
216216

217217

218-
def GetTargetsToBuild(product=False):
218+
def GetTargetsToBuild(product=False, additional_targets=[]):
219219
targets_to_build = [
220220
'flutter/shell/platform/fuchsia:fuchsia',
221-
]
221+
] + additional_targets
222222
return targets_to_build
223223

224224

225-
def BuildTarget(runtime_mode, arch, product, enable_lto):
225+
def BuildTarget(runtime_mode, arch, product, enable_lto, additional_targets=[]):
226226
out_dir = 'fuchsia_%s_%s' % (runtime_mode, arch)
227227
flags = [
228228
'--fuchsia',
@@ -276,6 +276,12 @@ def main():
276276
default=False,
277277
help='If set, skips building and just creates packages.')
278278

279+
parser.add_argument(
280+
'--targets',
281+
default='',
282+
help=('Comma-separated list; adds additional targets to build for '
283+
'Fuchsia.'))
284+
279285
args = parser.parse_args()
280286
RemoveDirectoryIfExists(_bucket_directory)
281287
build_mode = args.runtime_mode
@@ -292,7 +298,8 @@ def main():
292298
product = product_modes[i]
293299
if build_mode == 'all' or runtime_mode == build_mode:
294300
if not args.skip_build:
295-
BuildTarget(runtime_mode, arch, product, enable_lto)
301+
BuildTarget(runtime_mode, arch, product, enable_lto,
302+
args.targets.split(","))
296303
BuildBucket(runtime_mode, arch, product)
297304

298305
if args.upload:

0 commit comments

Comments
 (0)