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

Commit b61a6f5

Browse files
authored
[fuchsia] stamp package with target api level (#30857)
Infrastructure runs the pm command on packages in a different path which we were not accounting for. This will make sure we stamp the packages when infra builds them.
1 parent ad68b1b commit b61a6f5

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

tools/fuchsia/build_fuchsia_artifacts.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def CopyZirconFFILibIfExists(source, destination):
130130
destination_base = os.path.join(destination, 'flutter_binaries')
131131
FindFileAndCopyTo('libzircon_ffi.so', source_root, destination_base)
132132

133-
def CopyToBucketWithMode(source, destination, aot, product, runner_type):
133+
def CopyToBucketWithMode(source, destination, aot, product, runner_type, api_level):
134134
mode = 'aot' if aot else 'jit'
135135
product_suff = '_product' if product else ''
136136
runner_name = '%s_%s%s_runner' % (runner_type, mode, product_suff)
@@ -142,7 +142,7 @@ def CopyToBucketWithMode(source, destination, aot, product, runner_type):
142142
key_path = os.path.join(_script_dir, 'development.key')
143143

144144
destination = os.path.join(_bucket_directory, destination, mode)
145-
CreateFarPackage(pm_bin, far_base, key_path, destination)
145+
CreateFarPackage(pm_bin, far_base, key_path, destination, api_level)
146146
patched_sdk_dirname = '%s_runner_patched_sdk' % runner_type
147147
patched_sdk_dir = os.path.join(source_root, patched_sdk_dirname)
148148
dest_sdk_path = os.path.join(destination, patched_sdk_dirname)
@@ -154,10 +154,17 @@ def CopyToBucketWithMode(source, destination, aot, product, runner_type):
154154

155155

156156
def CopyToBucket(src, dst, product=False):
157-
CopyToBucketWithMode(src, dst, False, product, 'flutter')
158-
CopyToBucketWithMode(src, dst, True, product, 'flutter')
159-
CopyToBucketWithMode(src, dst, False, product, 'dart')
160-
CopyToBucketWithMode(src, dst, True, product, 'dart')
157+
api_level = ReadTargetAPILevel()
158+
CopyToBucketWithMode(src, dst, False, product, 'flutter', api_level)
159+
CopyToBucketWithMode(src, dst, True, product, 'flutter', api_level)
160+
CopyToBucketWithMode(src, dst, False, product, 'dart', api_level)
161+
CopyToBucketWithMode(src, dst, True, product, 'dart', api_level)
162+
163+
def ReadTargetAPILevel():
164+
filename = os.path.join(os.path.dirname(__file__), 'target_api_level')
165+
with open(filename) as f:
166+
api_level = f.read().rstrip('\n')
167+
return api_level
161168

162169

163170
def CopyVulkanDepsToBucket(src, dst, arch):

tools/fuchsia/gen_package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def GenerateManifest(package_dir):
3535
return manifest_path
3636

3737

38-
def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir):
38+
def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir, api_level):
3939
manifest_path = GenerateManifest(package_dir)
4040

4141
pm_command_base = [
42-
pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir
42+
pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir, '--api-level', api_level
4343
]
4444

4545
# Build the package

0 commit comments

Comments
 (0)