Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions tools/fuchsia/gen_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import subprocess
import sys

from gather_flutter_runner_artifacts import CreateMetaPackage


# Generates the manifest and returns the file.
def GenerateManifest(package_dir):
Expand Down Expand Up @@ -57,23 +59,35 @@ def main():
parser.add_argument(
'--signing-key', dest='signing_key', action='store', required=True)
parser.add_argument(
'--manifest-file', dest='manifest_file', action='store', required=True)
'--manifest-file', dest='manifest_file', action='store', required=False)
parser.add_argument(
'--far-name', dest='far_name', action='store', required=False)

args = parser.parse_args()

assert os.path.exists(args.pm_bin)
assert os.path.exists(args.package_dir)
assert os.path.exists(args.signing_key)
assert os.path.exists(args.manifest_file)

pkg_dir = args.package_dir
if not os.path.exists(os.path.join(pkg_dir, 'meta', 'package')):
CreateMetaPackage(pkg_dir, args.far_name)

manifest_file = None
if args.manifest_file is not None:
assert os.path.exists(args.manifest_file)
manifest_file = args.manifest_file
else:
manifest_file = GenerateManifest(args.package_dir)

pm_command_base = [
args.pm_bin,
'-o',
args.package_dir,
os.path.abspath(os.path.join(pkg_dir, os.pardir)),
'-k',
args.signing_key,
'-m',
args.manifest_file,
manifest_file,
]

# Build the package
Expand Down
2 changes: 2 additions & 0 deletions tools/fuchsia/package_dir.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ template("package_dir") {
assert(defined(invoker.binary), "package must define binary")
assert(defined(invoker.meta_dir), "package must define meta_dir")

pkg_testonly = defined(invoker.testonly) && invoker.testonly
pkg_target_name = target_name
pkg = {
package_version = "0" # placeholder
Expand Down Expand Up @@ -72,5 +73,6 @@ template("package_dir") {
deps = pkg.deps + [ ":$cmx_target" ]
args = [ "--file-list={{response_file_name}}" ]
outputs = copy_outputs
testonly = pkg_testonly
}
}