Skip to content

Commit

Permalink
More fixes for CI building.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron Bessems committed May 8, 2019
1 parent 9b08d5d commit a89edb3
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import 'dart:io';

import 'package:grinder_coveralls/grinder_coveralls.dart' as coveralls;

var files = [ "transformers.dart", "transaction.dart", "types.dart" ];

/// Starts the build system.
Future<void> main(List<String> args) => grind(args);


@Task('Collects the code coverage of Dart scripts from a given directory')
Future<String> collect() async {
var files = [ "transformers.dart", "transaction.dart", "types.dart" ];


await Directory("lib").create();
files.forEach( (file) {
Expand All @@ -20,13 +22,7 @@ Future<String> collect() async {
});

var s = await coveralls.collectCoverage(getFile('test.dart'),saveAs: 'lcov.info', basePath: Directory.current.path, reportOn: ["lib"]);

files.forEach( (file) {
print("Deleting $file");
File("lib/$file").delete();
});

await Directory("lib").delete();

return s;

}
Expand All @@ -36,5 +32,12 @@ Future<String> collect() async {
config['repo_token'] = Platform.environment['COVERALLS_REPO_TOKEN'];

final coverage = await getFile('lcov.info').readAsString();
return coveralls.uploadCoverage(coverage, configuration: config);
await coveralls.uploadCoverage(coverage, configuration: config);

files.forEach( (file) {
print("Deleting $file");
File("lib/$file").deleteSync();
});

await Directory("lib").delete();
}

0 comments on commit a89edb3

Please sign in to comment.