throwException("Missing example code in ${file.path}. Either it didn't get published, publishing has changed, or the example no longer exists.");
}
}else{
throwException("Missing example code sanity test file ${file.path}. Either it didn't get published, or you might have to update the test to look at a different file.");
}
}
/// Runs a sanity check by running a test.
voidsanityCheckDocs(){
voidsanityCheckDocs(){
finalList<String>canaries=<String>[
finalList<String>canaries=<String>[
'$kPublishRoot/assets/overrides.css',
'$kPublishRoot/assets/overrides.css',
...
@@ -397,6 +416,22 @@ void sanityCheckDocs() {
...
@@ -397,6 +416,22 @@ void sanityCheckDocs() {
if(!File(canary).existsSync())
if(!File(canary).existsSync())
throwException('Missing "$canary", which probably means the documentation failed to build correctly.');
throwException('Missing "$canary", which probably means the documentation failed to build correctly.');
}
}
// Make sure at least one example of each kind includes source code.