def CopyGenSnapshotIfExists(source, destination): source_root = os.path.join(_out_dir, source) destination_base = os.path.join(destination, 'dart_binaries') gen_snapshot = FindFile('gen_snapshot', source_root) gen_snapshot_product = FindFile('gen_snapshot_product', source_root) if gen_snapshot: dst_path = os.path.join(destination_base, 'gen_snapshot') CopyPath(gen_snapshot, dst_path) if gen_snapshot_product: dst_path = os.path.join(destination_base, 'gen_snapshot_product') CopyPath(gen_snapshot_product, dst_path)
def FindFileAndCopyTo(file_name, source, dest_parent, dst_name=None): found = FindFile(file_name, source) if not dst_name: dst_name = file_name if found: dst_path = os.path.join(dest_parent, dst_name) CopyPath(found, dst_path)
def CopyBuildToBucket(runtime_mode, arch, optimized, product): unopt = "_unopt" if not optimized else "" out_dir = 'fuchsia_%s%s_%s/' % (runtime_mode, unopt, arch) bucket_dir = 'flutter/%s/%s%s/' % (arch, runtime_mode, unopt) deps_dir = 'flutter/%s/deps/' % (arch) CopyToBucket(out_dir, bucket_dir, product) CopyVulkanDepsToBucket(out_dir, deps_dir, arch) CopyIcuDepsToBucket(out_dir, deps_dir) # Copy the CIPD YAML template from the source directory to be next to the bucket # we are about to package. cipd_yaml = os.path.join(_script_dir, 'fuchsia.cipd.yaml') CopyFiles(cipd_yaml, os.path.join(_bucket_directory, 'fuchsia.cipd.yaml')) # Copy the license files from the source directory to be next to the bucket we # are about to package. bucket_root = os.path.join(_bucket_directory, 'flutter') licenses_root = os.path.join(_src_root_dir, 'flutter/ci/licenses_golden') license_files = [ 'licenses_flutter', 'licenses_fuchsia', 'licenses_gpu', 'licenses_skia', 'licenses_third_party' ] for license in license_files: src_path = os.path.join(licenses_root, license) dst_path = os.path.join(bucket_root, license) CopyPath(src_path, dst_path)
def ProcessCIPDPackage(upload, engine_version): # Copy the CIPD YAML template from the source directory to be next to the bucket # we are about to package. cipd_yaml = os.path.join(_script_dir, 'fuchsia.cipd.yaml') CopyFiles(cipd_yaml, os.path.join(_bucket_directory, 'fuchsia.cipd.yaml')) # Copy the license files from the source directory to be next to the bucket we # are about to package. bucket_root = os.path.join(_bucket_directory, 'flutter') licenses_root = os.path.join(_src_root_dir, 'flutter/ci/licenses_golden') license_files = [ 'licenses_flutter', 'licenses_fuchsia', 'licenses_gpu', 'licenses_skia', 'licenses_third_party' ] for license in license_files: src_path = os.path.join(licenses_root, license) dst_path = os.path.join(bucket_root, license) CopyPath(src_path, dst_path) if not upload or not IsLinux(): RunCIPDCommandWithRetries([ 'cipd', 'pkg-build', '-pkg-def', 'fuchsia.cipd.yaml', '-out', os.path.join(_bucket_directory, 'fuchsia.cipd') ]) return # Everything after this point will only run iff `upload==true` and # `IsLinux() == true` assert (upload) assert (IsLinux()) if engine_version is None: print('--upload requires --engine-version to be specified.') return tag = 'git_revision:%s' % engine_version already_exists = CheckCIPDPackageExists('flutter/fuchsia', tag) if already_exists: print('CIPD package flutter/fuchsia tag %s already exists!' % tag) return RunCIPDCommandWithRetries([ 'cipd', 'create', '-pkg-def', 'fuchsia.cipd.yaml', '-ref', 'latest', '-tag', tag, ])
def CopyToBucket(source, destination, product=False): runner_name = 'flutter_jit_runner' if product: runner_name = 'flutter_jit_product_runner' far_dir = '%s_far' % runner_name source_root = os.path.join(_out_dir, source) source = os.path.join(source_root, far_dir) CreateMetaPackage(source, runner_name) pm_bin = GetPMBinPath() key_path = os.path.join(_script_dir, 'development.key') destination = os.path.join(_bucket_directory, destination) CreateFarPackage(pm_bin, source, key_path, destination) patched_sdk_dir = os.path.join(source_root, 'flutter_runner_patched_sdk') dest_sdk_path = os.path.join(destination, 'flutter_runner_patched_sdk') CopyPath(patched_sdk_dir, dest_sdk_path)
def CopyToBucketWithMode(source, destination, aot, product, runner_type): mode = 'aot' if aot else 'jit' product_suff = '_product' if product else '' runner_name = '%s_%s%s_runner' % (runner_type, mode, product_suff) far_dir_name = '%s_far' % runner_name source_root = os.path.join(_out_dir, source) far_base = os.path.join(source_root, far_dir_name) CreateMetaPackage(far_base, runner_name) pm_bin = GetPMBinPath() 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) patched_sdk_dir = os.path.join(source_root, 'flutter_runner_patched_sdk') dest_sdk_path = os.path.join(destination, 'flutter_runner_patched_sdk') if not os.path.exists(dest_sdk_path): CopyPath(patched_sdk_dir, dest_sdk_path) CopyGenSnapshotIfExists(source_root, destination)