Support for placing an AOT dylib in the flx. Part of Fuchsia AOT sup… (#9240)
Support for placing an AOT dylib in the flx. Part of Fuchsia AOT support.
This commit is contained in:
@@ -24,6 +24,7 @@ const String _kOptionPackages = 'packages';
|
||||
const String _kOptionOutput = 'output-file';
|
||||
const String _kOptionHeader = 'header';
|
||||
const String _kOptionSnapshot = 'snapshot';
|
||||
const String _kOptionDylib = 'dylib';
|
||||
const String _kOptionWorking = 'working-dir';
|
||||
const String _kOptionManifest = 'manifest';
|
||||
const String _kOptionDepFile = 'depfile';
|
||||
@@ -32,7 +33,6 @@ const List<String> _kRequiredOptions = const <String>[
|
||||
_kOptionPackages,
|
||||
_kOptionOutput,
|
||||
_kOptionHeader,
|
||||
_kOptionSnapshot,
|
||||
_kOptionWorking,
|
||||
_kOptionDepFile,
|
||||
_kOptionBuildRoot,
|
||||
@@ -60,6 +60,7 @@ Future<Null> run(List<String> args) async {
|
||||
..addOption(_kOptionPackages, help: 'The .packages file')
|
||||
..addOption(_kOptionOutput, help: 'The generated flx file')
|
||||
..addOption(_kOptionHeader, help: 'The header of the flx file')
|
||||
..addOption(_kOptionDylib, help: 'The generated AOT dylib file')
|
||||
..addOption(_kOptionSnapshot, help: 'The generated snapshot file')
|
||||
..addOption(_kOptionWorking,
|
||||
help: 'The directory where to put temporary files')
|
||||
@@ -75,9 +76,12 @@ Future<Null> run(List<String> args) async {
|
||||
Cache.flutterRoot = platform.environment['FLUTTER_ROOT'];
|
||||
final String outputPath = argResults[_kOptionOutput];
|
||||
try {
|
||||
final String snapshotPath = argResults[_kOptionSnapshot];
|
||||
final String dylibPath = argResults[_kOptionDylib];
|
||||
final List<String> dependencies = await assemble(
|
||||
outputPath: outputPath,
|
||||
snapshotFile: fs.file(argResults[_kOptionSnapshot]),
|
||||
snapshotFile: snapshotPath == null ? null : fs.file(snapshotPath),
|
||||
dylibFile: dylibPath == null ? null : fs.file(dylibPath),
|
||||
workingDirPath: argResults[_kOptionWorking],
|
||||
packagesPath: argResults[_kOptionPackages],
|
||||
manifestPath: argResults[_kOptionManifest] ?? defaultManifestPath,
|
||||
|
||||
@@ -27,6 +27,7 @@ const String defaultPrivateKeyPath = 'privatekey.der';
|
||||
|
||||
const String _kKernelKey = 'kernel_blob.bin';
|
||||
const String _kSnapshotKey = 'snapshot_blob.bin';
|
||||
const String _kDylibKey = 'libapp.so';
|
||||
|
||||
Future<int> createSnapshot({
|
||||
@required String mainPath,
|
||||
@@ -114,6 +115,7 @@ Future<List<String>> assemble({
|
||||
String manifestPath,
|
||||
DevFSContent kernelContent,
|
||||
File snapshotFile,
|
||||
File dylibFile,
|
||||
String outputPath,
|
||||
String privateKeyPath: defaultPrivateKeyPath,
|
||||
String workingDirPath,
|
||||
@@ -151,6 +153,8 @@ Future<List<String>> assemble({
|
||||
zipBuilder.entries[_kKernelKey] = kernelContent;
|
||||
if (snapshotFile != null)
|
||||
zipBuilder.entries[_kSnapshotKey] = new DevFSFileContent(snapshotFile);
|
||||
if (dylibFile != null)
|
||||
zipBuilder.entries[_kDylibKey] = new DevFSFileContent(dylibFile);
|
||||
|
||||
ensureDirectoryExists(outputPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user