Add a fake package that generates a link to the Android javadocs in the dartdoc output (#8032)

Fixes https://github.com/flutter/flutter/issues/7963
This commit is contained in:
Jason Simmons 2017-02-09 16:12:09 -08:00 committed by GitHub
parent 30f3a896e6
commit 6873cdfe30
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,2 @@
/// [Flutter platform integration APIs for Android.](https://docs.flutter.io/javadoc/)
library Android;

View File

@ -0,0 +1,2 @@
name: platform_integration

View File

@ -32,6 +32,10 @@ dependencies:
buf.writeln(' $package:');
buf.writeln(' sdk: flutter');
}
buf.writeln(' platform_integration: 0.0.1');
buf.writeln('dependency_overrides:');
buf.writeln(' platform_integration:');
buf.writeln(' path: platform_integration');
new File('dev/docs/pubspec.yaml').writeAsStringSync(buf.toString());
// Create the library file.
@ -67,6 +71,7 @@ dependencies:
'--use-categories'
];
for (String libraryRef in libraryRefs(diskPath: true)) {
args.add('--include-external');
args.add(libraryRef);
@ -134,6 +139,10 @@ void addHtmlBaseToIndex() {
String indexContents = indexFile.readAsStringSync();
indexContents = indexContents.replaceFirst('</title>\n',
'</title>\n <base href="./flutter/">\n');
indexContents = indexContents.replaceAll(
'href="Android/Android-library.html"',
'href="https://docs.flutter.io/javadoc/"'
);
indexFile.writeAsStringSync(indexContents);
}
@ -175,6 +184,12 @@ Iterable<String> libraryRefs({ bool diskPath: false }) sync* {
}
}
}
// Add a fake package for platform integration APIs.
if (diskPath)
yield 'platform_integration/lib/android.dart';
else
yield 'platform_integration/android.dart';
}
void printStream(Stream<List<int>> stream) {