@@ -527,6 +527,7 @@ Future<List<Map>> _buildTestPackageDocs(
527
527
}
528
528
529
529
@Task ('Build generated test package docs (with inherited docs and source code)' )
530
+ @Depends (clean)
530
531
Future <void > buildTestPackageDocs () async {
531
532
await _buildTestPackageDocs (
532
533
testPackageDocsDir.absolute.path, Future .value (Directory .current.path));
@@ -903,23 +904,44 @@ Future<void> tryPublish() async {
903
904
}
904
905
905
906
@Task ('Run a smoke test, only' )
907
+ @Depends (clean)
906
908
Future <void > smokeTest () async {
907
909
await testDart2 (smokeTestFiles);
908
910
await testFutures.wait ();
909
911
}
910
912
911
913
@Task ('Run non-smoke tests, only' )
914
+ @Depends (clean)
912
915
Future <void > longTest () async {
913
916
await testDart2 (testFiles);
914
917
await testFutures.wait ();
915
918
}
916
919
917
920
@Task ('Run all the tests.' )
921
+ @Depends (clean)
918
922
Future <void > test () async {
919
923
await testDart2 (smokeTestFiles.followedBy (testFiles));
920
924
await testFutures.wait ();
921
925
}
922
926
927
+ @Task ('Clean up pub data from test directories' )
928
+ Future <void > clean () async {
929
+ var toDelete = nonRootPubData;
930
+ toDelete.forEach ((e) => e.deleteSync (recursive: true ));
931
+ }
932
+
933
+ Iterable <FileSystemEntity > get nonRootPubData {
934
+ // This involves deleting things, so be careful.
935
+ if (! File (path.join ('tool' , 'grind.dart' )).existsSync ()) {
936
+ throw FileSystemException ('wrong CWD, run from root of dartdoc package' );
937
+ }
938
+ return Directory ('.' )
939
+ .listSync (recursive: true )
940
+ .where ((e) => path.dirname (e.path) != '.' )
941
+ .where ((e) => < String > ['.dart_tool' , '.packages' , 'pubspec.lock' ]
942
+ .contains (path.basename (e.path)));
943
+ }
944
+
923
945
List <File > get smokeTestFiles => Directory ('test' )
924
946
.listSync (recursive: true )
925
947
.whereType <File >()
@@ -1017,6 +1039,7 @@ Future<WarningsCollection> _buildDartdocFlutterPluginDocs() async {
1017
1039
}
1018
1040
1019
1041
@Task ('Build docs for a package that requires flutter with remote linking' )
1042
+ @Depends (clean)
1020
1043
Future <void > buildDartdocFlutterPluginDocs () async {
1021
1044
await _buildDartdocFlutterPluginDocs ();
1022
1045
}
0 commit comments