Commit 8a537534 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2107 from Hixie/flutter-tool

Fix --debug
parents 81df765d 71c8a96f
...@@ -123,10 +123,11 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -123,10 +123,11 @@ class FlutterCommandRunner extends CommandRunner {
defaultsTo: 'out/ios_sim_Release/'); defaultsTo: 'out/ios_sim_Release/');
} }
String get usageFooter => String get usageFooter {
'Run "flutter -h -v" for verbose help output, including less commonly used options.\n' return 'Run "flutter -h -v" for verbose help output, including less commonly used options.\n'
'\n' '\n'
'${doctor.summaryText}'; '${doctor.summaryText}';
}
List<BuildConfiguration> get buildConfigurations { List<BuildConfiguration> get buildConfigurations {
if (_buildConfigurations == null) if (_buildConfigurations == null)
...@@ -136,21 +137,17 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -136,21 +137,17 @@ class FlutterCommandRunner extends CommandRunner {
List<BuildConfiguration> _buildConfigurations; List<BuildConfiguration> _buildConfigurations;
String get enginePath { String get enginePath {
if (!_enginePathSet) { assert(ArtifactStore.flutterRoot != null);
_enginePath = _findEnginePath(_globalResults); _enginePath ??= _findEnginePath(_globalResults);
_enginePathSet = true;
}
return _enginePath; return _enginePath;
} }
String _enginePath; String _enginePath;
bool _enginePathSet = false;
ArgResults _globalResults; ArgResults _globalResults;
String get _defaultFlutterRoot { String get _defaultFlutterRoot {
if (Platform.environment.containsKey(kFlutterRootEnvironmentVariableName)) if (Platform.environment.containsKey(kFlutterRootEnvironmentVariableName))
return Platform.environment[kFlutterRootEnvironmentVariableName]; return Platform.environment[kFlutterRootEnvironmentVariableName];
try { try {
String script = Platform.script.toFilePath(); String script = Platform.script.toFilePath();
if (path.basename(script) == kSnapshotFileName) if (path.basename(script) == kSnapshotFileName)
...@@ -170,6 +167,12 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -170,6 +167,12 @@ class FlutterCommandRunner extends CommandRunner {
if (globalResults['verbose']) if (globalResults['verbose'])
logger.verbose = true; logger.verbose = true;
// we must set ArtifactStore.flutterRoot early because other features use it
// (e.g. enginePath's initialiser uses it)
ArtifactStore.flutterRoot = path.normalize(path.absolute(globalResults['flutter-root']));
if (globalResults.wasParsed('package-root'))
ArtifactStore.packageRoot = path.normalize(path.absolute(globalResults['package-root']));
// See if the user specified a specific device. // See if the user specified a specific device.
deviceManager.specifiedDeviceId = globalResults['device-id']; deviceManager.specifiedDeviceId = globalResults['device-id'];
...@@ -184,15 +187,10 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -184,15 +187,10 @@ class FlutterCommandRunner extends CommandRunner {
if (androidSdk != null) { if (androidSdk != null) {
printTrace('Using Android SDK at ${androidSdk.directory}.'); printTrace('Using Android SDK at ${androidSdk.directory}.');
if (androidSdk.latestVersion != null) if (androidSdk.latestVersion != null)
printTrace('${androidSdk.latestVersion}'); printTrace('${androidSdk.latestVersion}');
} }
ArtifactStore.flutterRoot = path.normalize(path.absolute(globalResults['flutter-root']));
if (globalResults.wasParsed('package-root'))
ArtifactStore.packageRoot = path.normalize(path.absolute(globalResults['package-root']));
if (globalResults['version']) { if (globalResults['version']) {
printStatus(getVersion(ArtifactStore.flutterRoot)); printStatus(getVersion(ArtifactStore.flutterRoot));
printStatus(''); printStatus('');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment