Skip to content

Commit

Permalink
Cleanup and document existing dependency validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Mar 23, 2018
1 parent 8515176 commit 79a61e5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions webdev/lib/src/pubspec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,24 @@ Future checkPubspecLock() async {
issues.add(PackageExceptionDetails.noBuildRunnerDep);
}

var version = buildRunner['version'] as String;
if (version == null) {
// TODO: warning?
} else {
var buildRunnerVersion = new Version.parse(version);
var source = buildRunner['source'] as String;
if (source == 'hosted') {
// NOTE: buildRunner['description'] should be:
// `{url: https://pub.dartlang.org, name: build_runner}`
// If a user is playing around here, they are on their own.

var version = buildRunner['version'] as String;
var buildRunnerVersion = new Version.parse(version);
if (!supportedBuildRunnerVersionRange.allows(buildRunnerVersion)) {
var error = 'The `build_runner` version – $buildRunnerVersion – is not '
'within the supported range – $supportedBuildRunnerVersionRange.';
issues.add(new PackageExceptionDetails._(error));
}
}

var source = buildRunner['source'] as String;
if (source == 'hosted') {
//var description = buildRunner['description'] as YamlMap;
// TODO: check for `{url: https://pub.dartlang.org, name: build_runner}`
// If not, print a warning
stderr.writeln('hosted: $buildRunner');
} else {
// TODO: print a warning that we're assuming hosted
// NOTE: Intentionally not checking non-hosted dependencies: git, path
// If a user is playing around here, they are on their own.
}
}

Expand Down

0 comments on commit 79a61e5

Please sign in to comment.