From 27118f39ea94b5ab3452cfa5af1a0f6f3f6d399f Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 2 Nov 2015 12:54:05 -0800 Subject: [PATCH] Add a default maniest path for build --- packages/flutter_tools/lib/src/commands/build.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart index 6abcf13cdf..b82402cc3e 100644 --- a/packages/flutter_tools/lib/src/commands/build.dart +++ b/packages/flutter_tools/lib/src/commands/build.dart @@ -85,7 +85,7 @@ Iterable<_MaterialAsset> _parseMaterialAssets(Map manifestDescriptor) sync* { } dynamic _loadManifest(String manifestPath) { - if (manifestPath == null) + if (manifestPath == null || !FileSystemEntity.isFileSync(manifestPath)) return null; String manifestDescriptor = new File(manifestPath).readAsStringSync(); return loadYaml(manifestDescriptor); @@ -107,6 +107,7 @@ ArchiveFile _createSnapshotFile(String snapshotPath) { const String _kDefaultAssetBase = 'packages/material_design_icons/icons'; const String _kDefaultMainPath = 'lib/main.dart'; +const String _kDefaultManifestPath = 'flutter.yaml'; const String _kDefaultOutputPath = 'app.flx'; const String _kDefaultSnapshotPath = 'snapshot_blob.bin'; const String _kDefaultPrivateKeyPath = 'privatekey.der'; @@ -120,7 +121,7 @@ class BuildCommand extends FlutterCommand { argParser.addOption('asset-base', defaultsTo: _kDefaultAssetBase); argParser.addOption('compiler'); argParser.addOption('main', defaultsTo: _kDefaultMainPath); - argParser.addOption('manifest'); + argParser.addOption('manifest', defaultsTo: _kDefaultManifestPath); argParser.addOption('private-key', defaultsTo: _kDefaultPrivateKeyPath); argParser.addOption('output-file', abbr: 'o', defaultsTo: _kDefaultOutputPath); argParser.addOption('snapshot', defaultsTo: _kDefaultSnapshotPath); @@ -149,7 +150,7 @@ class BuildCommand extends FlutterCommand { Future build({ String assetBase: _kDefaultAssetBase, String mainPath: _kDefaultMainPath, - String manifestPath, + String manifestPath: _kDefaultManifestPath, String outputPath: _kDefaultOutputPath, String snapshotPath: _kDefaultSnapshotPath, String privateKeyPath: _kDefaultPrivateKeyPath,