Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[flutter_plugin_tools] Make unit tests pass on Windows #4149

Merged
merged 19 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix version check tests
  • Loading branch information
stuartmorgan committed Jul 9, 2021
commit 15fb1b8454943f3a7f7c4b2c7d5ba7b7da72746d
10 changes: 8 additions & 2 deletions script/tool/lib/src/version_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:file/file.dart';
import 'package:git/git.dart';
import 'package:http/http.dart' as http;
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';
import 'package:pubspec_parse/pubspec_parse.dart';

Expand Down Expand Up @@ -178,8 +179,13 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body}
required GitVersionFinder gitVersionFinder,
}) async {
final File pubspecFile = package.childFile('pubspec.yaml');
return await gitVersionFinder.getPackageVersion(
path.relative(pubspecFile.absolute.path, from: (await gitDir).path));
final String relativePath =
path.relative(pubspecFile.absolute.path, from: (await gitDir).path);
// Use Posix-style paths for git.
final String gitPath = path.style == p.Style.windows
? p.posix.joinAll(path.split(relativePath))
: relativePath;
return await gitVersionFinder.getPackageVersion(gitPath);
}

/// Returns true if the version of [package] is either unchanged relative to
Expand Down
1 change: 0 additions & 1 deletion script/tool/test/lint_podspecs_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_plugin_tools/src/common/core.dart';
import 'package:flutter_plugin_tools/src/lint_podspecs_command.dart';
import 'package:path/path.dart' as p;
import 'package:test/test.dart';

import 'mocks.dart';
Expand Down