Skip to content

Commit

Permalink
pigeon: fixed windows execution by using posix path imports (flutter#230
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gaaclarke authored Oct 20, 2020
1 parent c4e9a08 commit 4e89dd0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.13

* Fixed execution on Windows with certain setups where Dart didn't allow
backslashes in `import` statements.

## 0.1.12

* Fixed assert failure with creating a PlatformException as a result of an
Expand Down
6 changes: 5 additions & 1 deletion packages/pigeon/bin/pigeon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ Future<void> main(List<String> args) async {
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 List<String> relInputComponents = path.split(relInputPath);
final path.Context context = path.Context(style: path.Style.posix);
final String posixRelInputPath = context.joinAll(relInputComponents);
importLine = 'import \'$posixRelInputPath\';\n';
}
final String code = """$importLine
import 'dart:io';
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'dart:mirrors';
import 'ast.dart';

/// The current version of pigeon.
const String pigeonVersion = '0.1.12';
const String pigeonVersion = '0.1.13';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pigeon
version: 0.1.12
version: 0.1.13
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:
Expand Down

0 comments on commit 4e89dd0

Please sign in to comment.