@@ -33,6 +33,10 @@ expectFileContains(String path, List<Pattern> items) {
3333 }
3434}
3535
36+ /// The pub cache inherited by grinder.
37+ final String defaultPubCache =
38+ Platform .environment['PUB_CACHE' ] ?? resolveTildePath ('~/.pub-cache' );
39+
3640/// Run no more than the number of processors available in parallel.
3741final MultiFutureTracker testFutures = new MultiFutureTracker (
3842 Platform .environment.containsKey ('TRAVIS' )
@@ -183,11 +187,11 @@ Future buildSdkDocs() async {
183187
184188class WarningsCollection {
185189 final String tempDir;
186- final Map <String , int > _warningKeyCounts ;
190+ final Map <String , int > warningKeyCounts ;
187191 final String branch;
188192 final String pubCachePath;
189193 WarningsCollection (this .tempDir, this .pubCachePath, this .branch)
190- : this ._warningKeyCounts = new Map () {}
194+ : this .warningKeyCounts = new Map () {}
191195
192196 static const String kPubCachePathReplacement = '_xxxPubDirectoryxxx_' ;
193197 static const String kTempDirReplacement = '_xxxTempDirectoryxxx_' ;
@@ -208,8 +212,8 @@ class WarningsCollection {
208212
209213 void add (String text) {
210214 String key = _toKey (text);
211- _warningKeyCounts .putIfAbsent (key, () => 0 );
212- _warningKeyCounts [key]++ ;
215+ warningKeyCounts .putIfAbsent (key, () => 0 );
216+ warningKeyCounts [key]++ ;
213217 }
214218
215219 /// Output formatter for comparing warnings. [this] is the original.
@@ -220,19 +224,19 @@ class WarningsCollection {
220224 Set <String > onlyCurrent = new Set ();
221225 Set <String > identical = new Set ();
222226 Set <String > allKeys = new Set .from ([]
223- ..addAll (_warningKeyCounts .keys)
224- ..addAll (current._warningKeyCounts .keys));
227+ ..addAll (warningKeyCounts .keys)
228+ ..addAll (current.warningKeyCounts .keys));
225229
226230 for (String key in allKeys) {
227- if (_warningKeyCounts .containsKey (key) &&
228- ! current._warningKeyCounts .containsKey (key)) {
231+ if (warningKeyCounts .containsKey (key) &&
232+ ! current.warningKeyCounts .containsKey (key)) {
229233 onlyOriginal.add (key);
230- } else if (! _warningKeyCounts .containsKey (key) &&
231- current._warningKeyCounts .containsKey (key)) {
234+ } else if (! warningKeyCounts .containsKey (key) &&
235+ current.warningKeyCounts .containsKey (key)) {
232236 onlyCurrent.add (key);
233- } else if (_warningKeyCounts .containsKey (key) &&
234- current._warningKeyCounts .containsKey (key) &&
235- _warningKeyCounts [key] != current._warningKeyCounts [key]) {
237+ } else if (warningKeyCounts .containsKey (key) &&
238+ current.warningKeyCounts .containsKey (key) &&
239+ warningKeyCounts [key] != current.warningKeyCounts [key]) {
236240 quantityChangedOuts.add (key);
237241 } else {
238242 identical.add (key);
@@ -253,7 +257,7 @@ class WarningsCollection {
253257 printBuffer.writeln ('*** $title : Identical warning quantity changed' );
254258 for (String key in quantityChangedOuts) {
255259 printBuffer.writeln (
256- "* Appeared ${_warningKeyCounts [key ]} times in $branch , ${current ._warningKeyCounts [key ]} in ${current .branch }:" );
260+ "* Appeared ${warningKeyCounts [key ]} times in $branch , ${current .warningKeyCounts [key ]} in ${current .branch }:" );
257261 printBuffer.writeln (current._fromKey (key));
258262 }
259263 }
@@ -813,26 +817,38 @@ Future serveDartdocFlutterPluginDocs() async {
813817 pluginPackageDocsDir.path, 8005 , 'serve-dartdoc-flutter-plugin-docs' );
814818}
815819
816- @Task ('Build docs for a package that requires flutter with remote linking' )
817- buildDartdocFlutterPluginDocs () async {
820+ Future <WarningsCollection > _buildDartdocFlutterPluginDocs () async {
818821 FlutterRepo flutterRepo = await FlutterRepo .fromExistingFlutterRepo (
819822 await cleanFlutterRepo, 'docs-flutter-plugin' );
820823
821- await flutterRepo.launcher.runStreamed (
822- Platform .resolvedExecutable,
823- [
824- '--checked' ,
825- pathLib.join (Directory .current.path, 'bin' , 'dartdoc.dart' ),
826- '--link-to-remote' ,
827- '--output' ,
828- pluginPackageDocsDir.path
829- ],
830- workingDirectory: pluginPackage.path);
824+ return jsonMessageIterableToWarnings (
825+ await flutterRepo.launcher.runStreamed (
826+ Platform .resolvedExecutable,
827+ [
828+ '--checked' ,
829+ pathLib.join (Directory .current.path, 'bin' , 'dartdoc.dart' ),
830+ '--json' ,
831+ '--link-to-remote' ,
832+ '--output' ,
833+ pluginPackageDocsDir.path
834+ ],
835+ workingDirectory: pluginPackage.path),
836+ pluginPackageDocsDir.path,
837+ defaultPubCache,
838+ 'HEAD' );
839+ }
840+
841+ @Task ('Build docs for a package that requires flutter with remote linking' )
842+ buildDartdocFlutterPluginDocs () async {
843+ await _buildDartdocFlutterPluginDocs ();
831844}
832845
833846@Task ('Verify docs for a package that requires flutter with remote linking' )
834- @Depends (buildDartdocFlutterPluginDocs)
835847testDartdocFlutterPlugin () async {
848+ WarningsCollection warnings = await _buildDartdocFlutterPluginDocs ();
849+ if (! warnings.warningKeyCounts.isEmpty) {
850+ fail ('No warnings should exist in : ${warnings .warningKeyCounts }' );
851+ }
836852 // Verify that links to Dart SDK and Flutter SDK go to the flutter site.
837853 expectFileContains (
838854 pathLib.join (
0 commit comments