diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 4d0ef22ebb44..3763675dc3f6 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.9 + +* Fixed bug where executing pigeon without arguments would crash (introduced in 0.1.8). + ## 0.1.8 * Started spawning pigeon_lib in an isolate instead of a subprocess. The diff --git a/packages/pigeon/bin/pigeon.dart b/packages/pigeon/bin/pigeon.dart index 72497a87cd5e..441595617646 100644 --- a/packages/pigeon/bin/pigeon.dart +++ b/packages/pigeon/bin/pigeon.dart @@ -10,14 +10,15 @@ import 'package:pigeon/pigeon_lib.dart'; Future main(List args) async { final PigeonOptions opts = Pigeon.parseArgs(args); - assert(opts.input != null); - final String rawInputPath = opts.input; final Directory tempDir = Directory.systemTemp.createTempSync(); - final String absInputPath = File(rawInputPath).absolute.path; - final String relInputPath = path.relative(absInputPath, from: tempDir.path); - final String importLine = - (opts.input != null) ? 'import \'$relInputPath\';\n' : ''; + String importLine = ''; + if (opts.input != null) { + final String rawInputPath = opts.input; + final String absInputPath = File(rawInputPath).absolute.path; + final String relInputPath = path.relative(absInputPath, from: tempDir.path); + importLine = 'import \'$relInputPath\';\n'; + } final String code = """$importLine import 'dart:io'; import 'dart:isolate'; diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 940fa19d0060..05a9c6795b7e 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -8,7 +8,7 @@ import 'dart:mirrors'; import 'ast.dart'; /// The current version of pigeon. -const String pigeonVersion = '0.1.8'; +const String pigeonVersion = '0.1.9'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index d2ff73ccc37c..c9324df0e472 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -1,5 +1,5 @@ name: pigeon -version: 0.1.8 +version: 0.1.9 description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. homepage: https://github.com/flutter/packages/tree/master/packages/pigeon dependencies: diff --git a/packages/pigeon/run_tests.sh b/packages/pigeon/run_tests.sh index 9650f6d4d5bf..15e4093151fe 100755 --- a/packages/pigeon/run_tests.sh +++ b/packages/pigeon/run_tests.sh @@ -73,6 +73,11 @@ test_pigeon_android() { pub get pub run test test/ +############################################################################### +# Execute without arguments test +############################################################################### +pub run pigeon + ############################################################################### # Compilation tests (Code is generated and compiled) ###############################################################################