Skip to content

Commit

Permalink
[fuchsia] Adds --targets arg for build_fuchsia_artifacts.py (flutter#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
filmil authored Jun 22, 2020
1 parent 1913040 commit 2a5053f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ def GetRunnerTarget(runner_type, product, aot):
return base + target


def GetTargetsToBuild(product=False):
def GetTargetsToBuild(product=False, additional_targets=[]):
targets_to_build = [
'flutter/shell/platform/fuchsia:fuchsia',
]
] + additional_targets
return targets_to_build


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

parser.add_argument(
'--targets',
default='',
help=('Comma-separated list; adds additional targets to build for '
'Fuchsia.'))

args = parser.parse_args()
RemoveDirectoryIfExists(_bucket_directory)
build_mode = args.runtime_mode
Expand All @@ -292,7 +298,8 @@ def main():
product = product_modes[i]
if build_mode == 'all' or runtime_mode == build_mode:
if not args.skip_build:
BuildTarget(runtime_mode, arch, product, enable_lto)
BuildTarget(runtime_mode, arch, product, enable_lto,
args.targets.split(","))
BuildBucket(runtime_mode, arch, product)

if args.upload:
Expand Down

0 comments on commit 2a5053f

Please sign in to comment.