Skip to content

Commit

Permalink
try different posix fix, widen analyzer, pubignore
Browse files Browse the repository at this point in the history
  • Loading branch information
robbecker-wf committed Jan 31, 2023
1 parent f71d669 commit 1e0fbd0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Dockerfile
skynet.yaml
.dart_tool/
.idea/
.packages
.pub/
build/
/doc/api/
/pubspec.lock
test/
tool/
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
sdk: ">=2.11.0 <3.0.0"

dependencies:
analyzer: '>=1.0.0 <3.0.0'
analyzer: '>=1.0.0 <6.0.0'
args: ^2.0.0
async: ^2.3.0
build_runner: '>=1.0.0 <3.0.0'
Expand Down
13 changes: 9 additions & 4 deletions test/functional.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ Future<TestProcess> runDevToolFunctionalTest(
.where((f) => p.basename(f.path) == 'pubspec.yaml')
.map((f) => f.absolute);
final pathDepPattern = RegExp(r'path: (.*)');
final posix = p.Context(style: p.Style.posix);

for (final pubspec in pubspecs) {
final updated =
pubspec.readAsStringSync().replaceAllMapped(pathDepPattern, (match) {
final relDepPath = match.group(1);
final relPubspecPath = posix.relative(pubspec.path, from: d.sandbox);
final absPath = posix.absolute(posix.normalize(
posix.join(templateDir.path, relPubspecPath, relDepPath, '..')));
final relPubspecPath = p.relative(pubspec.path, from: d.sandbox);
var absPath = p.absolute(p.normalize(
p.join(templateDir.path, relPubspecPath, relDepPath, '..')));
// Since pubspec paths should always be posix style or dart analyze
// complains, switch to forward slashes on windows
if (Platform.isWindows) {
absPath = absPath.replaceAll('\\', '/');
}
return 'path: $absPath';
});
pubspec.writeAsStringSync(updated);
Expand Down

0 comments on commit 1e0fbd0

Please sign in to comment.