Merge pull request #521 from abarth/fix_analyzer
Fix analyzer warnings in updater package
This commit is contained in:
@@ -96,6 +96,7 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
pubSpecDirectories.add(flutterDir.path);
|
||||
|
||||
// .../packages/*/bin/*.dart
|
||||
// .../packages/*/lib/main.dart
|
||||
Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages'));
|
||||
for (FileSystemEntity entry in packages.listSync()) {
|
||||
if (entry is Directory) {
|
||||
@@ -109,6 +110,11 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
String mainPath = path.join(entry.path, 'lib', 'main.dart');
|
||||
if (FileSystemEntity.isFileSync(mainPath)) {
|
||||
dartFiles.add(mainPath);
|
||||
foundOne = true;
|
||||
}
|
||||
if (foundOne)
|
||||
pubSpecDirectories.add(entry.path);
|
||||
}
|
||||
@@ -298,4 +304,4 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
print('No analyzer warnings!');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class UpdateTask {
|
||||
|
||||
Future<yaml.YamlMap> _fetchManifest() async {
|
||||
String manifestUrl = _currentManifest['update-url'] + '/' + kManifestFile;
|
||||
String manifestData = await http.get(manifestUrl);
|
||||
String manifestData = (await http.get(manifestUrl)).body;
|
||||
return yaml.loadYaml(manifestData, sourceUrl: manifestUrl);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ import 'package:mojo/core.dart';
|
||||
// Helper class to drain the contents of a mojo data pipe to a file.
|
||||
class PipeToFile {
|
||||
MojoDataPipeConsumer _consumer;
|
||||
MojoEventStream _eventStream;
|
||||
MojoEventSubscription _eventStream;
|
||||
IOSink _outputStream;
|
||||
|
||||
PipeToFile(this._consumer, String outputPath) {
|
||||
_eventStream = new MojoEventStream(_consumer.handle);
|
||||
_eventStream = new MojoEventSubscription(_consumer.handle);
|
||||
_outputStream = new File(outputPath).openWrite();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class PipeToFile {
|
||||
Future drain() async {
|
||||
Completer completer = new Completer();
|
||||
// TODO(mpcomplete): Is it legit to pass an async callback to listen?
|
||||
_eventStream.listen((List<int> event) async {
|
||||
_eventStream.subscribe((List<int> event) async {
|
||||
MojoHandleSignals mojoSignals = new MojoHandleSignals(event[1]);
|
||||
if (mojoSignals.isReadable) {
|
||||
MojoResult result = await _doRead();
|
||||
|
||||
Reference in New Issue
Block a user