Commit 6ff84d08 authored by Danny Tuppeny's avatar Danny Tuppeny Committed by Danny Tuppeny

Improve formatting

parent c0b2e783
......@@ -44,10 +44,12 @@ class AndroidEmulator extends Emulator {
@override
Future<bool> launch() async {
final Status status = logger.startProgress('Launching $id...');
final RunResult launchResult = await runAsync(<String>[getEmulatorPath(), '-avd', id]);
final RunResult launchResult =
await runAsync(<String>[getEmulatorPath(), '-avd', id]);
status.stop();
if (launchResult.exitCode != 0) {
printError('Error: emulator exited with exit code ${launchResult.exitCode}');
printError(
'Error: emulator exited with exit code ${launchResult.exitCode}');
printError('$launchResult');
return false;
}
......@@ -86,7 +88,8 @@ AndroidEmulator _createEmulator(String id) {
if (ini['path'] != null) {
final File configFile = fs.file(fs.path.join(ini['path'], 'config.ini'));
if (configFile.existsSync()) {
final Map<String, String> properties = parseIniLines(configFile.readAsLinesSync());
final Map<String, String> properties =
parseIniLines(configFile.readAsLinesSync());
return new AndroidEmulator(id, properties);
}
}
......@@ -100,11 +103,12 @@ Map<String, String> parseIniLines(List<String> contents) {
final Iterable<List<String>> properties = contents
.map((String l) => l.trim())
.where((String l) =>
l != '' && !l.startsWith('#')) // Strip blank lines/comments
.where((String l) =>
l.contains('=')) // Discard anything that isn't simple name=value
.map((String l) => l.split('=')); // Split into name/value
// Strip blank lines/comments
.where((String l) => l != '' && !l.startsWith('#'))
// Discard anything that isn't simple name=value
.where((String l) => l.contains('='))
// Split into name/value
.map((String l) => l.split('='));
for (List<String> property in properties) {
results[property[0].trim()] = property[1].trim();
......
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