Skip to content

Commit d7ebed1

Browse files
committed
pigeon: fixed windows execution by using posix path imports
1 parent c4e9a08 commit d7ebed1

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

packages/pigeon/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.13
2+
3+
* Fixed execution on Windows with certain setups where Dart didn't allow
4+
backslashes in `import` statements.
5+
16
## 0.1.12
27

38
* Fixed assert failure with creating a PlatformException as a result of an

packages/pigeon/bin/pigeon.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ Future<void> main(List<String> args) async {
1818
final String rawInputPath = opts.input;
1919
final String absInputPath = File(rawInputPath).absolute.path;
2020
final String relInputPath = path.relative(absInputPath, from: tempDir.path);
21-
importLine = 'import \'$relInputPath\';\n';
21+
22+
final List<String> relInputComponents = path.split(relInputPath);
23+
final path.Context context = path.Context(style: path.Style.posix);
24+
final String posixRelInputPath = context.joinAll(relInputComponents);
25+
importLine = 'import \'$posixRelInputPath\';\n';
2226
}
2327
final String code = """$importLine
2428
import 'dart:io';

packages/pigeon/lib/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'dart:mirrors';
88
import 'ast.dart';
99

1010
/// The current version of pigeon.
11-
const String pigeonVersion = '0.1.12';
11+
const String pigeonVersion = '0.1.13';
1212

1313
/// Read all the content from [stdin] to a String.
1414
String readStdin() {

packages/pigeon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pigeon
2-
version: 0.1.12
2+
version: 0.1.13
33
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
44
homepage: https://github.com/flutter/packages/tree/master/packages/pigeon
55
dependencies:

0 commit comments

Comments
 (0)