mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Add a manifest parameter to flutter_app. (#3268)
This will ensure the flx file is rebuilt whenever the manifest is modified.
This commit is contained in:
@@ -22,6 +22,9 @@ import("//build/dart/dart_package.gni")
|
||||
# deps (optional)
|
||||
# List of Dart packages the application depends on.
|
||||
#
|
||||
# manifest (optional)
|
||||
# Path to the manifest file
|
||||
#
|
||||
# analysis_options (optional)
|
||||
# By default, a script to run the analyzer on the contents of the package is
|
||||
# generated in the output directory. This parameter contains the path to an
|
||||
@@ -122,6 +125,9 @@ template("flutter_app") {
|
||||
inputs = [
|
||||
snapshot_path,
|
||||
]
|
||||
if (defined(invoker.manifest)) {
|
||||
inputs += [ rebase_path(invoker.manifest) ]
|
||||
}
|
||||
|
||||
outputs = [
|
||||
bundle_path,
|
||||
@@ -151,6 +157,12 @@ template("flutter_app") {
|
||||
"--snapshot",
|
||||
rebase_path(snapshot_path),
|
||||
]
|
||||
if (defined(invoker.manifest)) {
|
||||
args += [
|
||||
"--manifest",
|
||||
rebase_path(invoker.manifest)
|
||||
]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":$flutter_snapshot_name",
|
||||
|
||||
+7
-2
@@ -32,6 +32,7 @@ def main():
|
||||
help='Path to application snapshot')
|
||||
parser.add_argument('--output-file', type=str, required=True,
|
||||
help='Where to output application bundle')
|
||||
parser.add_argument('--manifest', type=str, help='The application manifest')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -39,7 +40,7 @@ def main():
|
||||
env['LD_LIBRARY_PATH'] = args.root
|
||||
env['FLUTTER_ROOT'] = args.flutter_root
|
||||
|
||||
result = subprocess.call([
|
||||
call_args = [
|
||||
args.dart,
|
||||
'--packages=%s' % args.flutter_tools_packages,
|
||||
args.flutter_tools_main,
|
||||
@@ -48,7 +49,11 @@ def main():
|
||||
'--snapshot=%s' % args.snapshot,
|
||||
'--output-file=%s' % args.output_file,
|
||||
'--header=#!fuchsia file:///system/apps/flutter_runner',
|
||||
], env=env, cwd=args.app_dir)
|
||||
]
|
||||
if 'manifest' in args:
|
||||
call_args.append('--manifest=%s' % args.manifest)
|
||||
|
||||
result = subprocess.call(call_args, env=env, cwd=args.app_dir)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user