Skip to content

Commit

Permalink
[fuchsia] stamp package with target api level (flutter#30857)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chaselatta authored Jan 14, 2022
1 parent ad68b1b commit b61a6f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def CopyZirconFFILibIfExists(source, destination):
destination_base = os.path.join(destination, 'flutter_binaries')
FindFileAndCopyTo('libzircon_ffi.so', source_root, destination_base)

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

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


def CopyToBucket(src, dst, product=False):
CopyToBucketWithMode(src, dst, False, product, 'flutter')
CopyToBucketWithMode(src, dst, True, product, 'flutter')
CopyToBucketWithMode(src, dst, False, product, 'dart')
CopyToBucketWithMode(src, dst, True, product, 'dart')
api_level = ReadTargetAPILevel()
CopyToBucketWithMode(src, dst, False, product, 'flutter', api_level)
CopyToBucketWithMode(src, dst, True, product, 'flutter', api_level)
CopyToBucketWithMode(src, dst, False, product, 'dart', api_level)
CopyToBucketWithMode(src, dst, True, product, 'dart', api_level)

def ReadTargetAPILevel():
filename = os.path.join(os.path.dirname(__file__), 'target_api_level')
with open(filename) as f:
api_level = f.read().rstrip('\n')
return api_level


def CopyVulkanDepsToBucket(src, dst, arch):
Expand Down
4 changes: 2 additions & 2 deletions tools/fuchsia/gen_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def GenerateManifest(package_dir):
return manifest_path


def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir):
def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir, api_level):
manifest_path = GenerateManifest(package_dir)

pm_command_base = [
pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir
pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir, '--api-level', api_level
]

# Build the package
Expand Down

0 comments on commit b61a6f5

Please sign in to comment.