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

Commit 679e408

Browse files
authored
Add ability to stamp fuchsia packages with API level (#29851)
1 parent 0477e05 commit 679e408

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ allowed_hosts = [
9999
]
100100

101101
deps = {
102-
'src': 'https://github.com/flutter/buildroot.git' + '@' + '0b267aac6794712a6d9d0f31dda3f844325d0258',
102+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '42be4395efc85e455bbdd555ef2791615338dbea',
103103

104104
# Fuchsia compatibility
105105
#

tools/fuchsia/fuchsia_archive.gni

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5+
import("//build/fuchsia/config.gni")
56
import("//flutter/tools/fuchsia/fuchsia_debug_symbols.gni")
67
import("//flutter/tools/fuchsia/fuchsia_libs.gni")
78

@@ -149,6 +150,14 @@ template("_fuchsia_archive") {
149150
"--manifest-json-file",
150151
rebase_path(manifest_json_file, root_build_dir),
151152
]
153+
154+
if (fuchsia_target_api_level != -1) {
155+
args += [
156+
"--api-level",
157+
"${fuchsia_target_api_level}",
158+
]
159+
}
160+
152161
outputs = [
153162
manifest_json_file,
154163
"${far_base_dir}.manifest",

tools/fuchsia/gen_package.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def main():
6363
'--manifest-json-file', dest='manifest_json_file', action='store', required=True)
6464
parser.add_argument(
6565
'--far-name', dest='far_name', action='store', required=False)
66+
parser.add_argument(
67+
'--api-level', dest='api_level', action='store', required=False)
6668

6769
args = parser.parse_args()
6870

@@ -98,10 +100,18 @@ def main():
98100
# Use check_output so if anything goes wrong we get the output.
99101
try:
100102

103+
build_command = ['build', '--output-package-manifest', args.manifest_json_file]
104+
105+
if args.api_level is not None:
106+
build_command = ['--api-level', args.api_level] + build_command
107+
108+
archive_command = ['archive', '--output='+ os.path.join(os.path.dirname(output_dir), args.far_name + "-0")]
109+
101110
pm_commands = [
102-
['build', '--output-package-manifest', args.manifest_json_file],
103-
['archive', '--output='+ os.path.join(os.path.dirname(output_dir), args.far_name + "-0")],
111+
build_command,
112+
archive_command
104113
]
114+
105115
for pm_command in pm_commands:
106116
subprocess.check_output(pm_command_base + pm_command)
107117
except subprocess.CalledProcessError as e:

tools/gn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ def to_gn_args(args):
404404
if args.target_os in ['android'] and gn_args['target_cpu'] in ['x64' , 'arm64']:
405405
gn_args['dart_use_compressed_pointers'] = True
406406

407+
if args.fuchsia_target_api_level is not None:
408+
gn_args['fuchsia_target_api_level'] = args.fuchsia_target_api_level
409+
407410
return gn_args
408411

409412
def parse_args(args):
@@ -509,6 +512,8 @@ def parse_args(args):
509512
'true and is enabled on CI.')
510513
parser.add_argument('--no-prebuilt-dart-sdk', dest='prebuilt_dart_sdk', action='store_false')
511514

515+
parser.add_argument('--fuchsia-target-api-level', dest='fuchsia_target_api_level')
516+
512517
# Sanitizers.
513518
parser.add_argument('--asan', default=False, action='store_true')
514519
parser.add_argument('--lsan', default=False, action='store_true')

0 commit comments

Comments
 (0)