forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the snapshot generation into a separate action (flutter#3168)
This is to ensure that the depfile generated by the snapshotter has the correct target.
- Loading branch information
Showing
3 changed files
with
88 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2016 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import argparse | ||
import subprocess | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Snapshot a Flutter application') | ||
|
||
parser.add_argument('--snapshotter-path', type=str, required=True, | ||
help='The Flutter snapshotter') | ||
parser.add_argument('--app-dir', type=str, required=True, | ||
help='The root of the app') | ||
parser.add_argument('--main-dart', type=str, required=True, | ||
help='The main.dart file to use') | ||
parser.add_argument('--packages', type=str, required=True, | ||
help='The package map to use') | ||
parser.add_argument('--snapshot', type=str, required=True, | ||
help='Path to application snapshot') | ||
parser.add_argument('--depfile', type=str, required=True, | ||
help='Where to output dependency information') | ||
parser.add_argument('--build-output', type=str, required=True, | ||
help='Target name used in the depfile') | ||
|
||
args = parser.parse_args() | ||
|
||
result = subprocess.call([ | ||
args.snapshotter_path, | ||
'--packages=%s' % args.packages, | ||
'--snapshot=%s' % args.snapshot, | ||
'--depfile=%s' % args.depfile, | ||
'--build-output=%s' % args.build_output, | ||
args.main_dart, | ||
], cwd=args.app_dir) | ||
|
||
return result | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |