Commit 6873cdfe authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

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
parent 30f3a896
/// [Flutter platform integration APIs for Android.](https://docs.flutter.io/javadoc/)
library Android;
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment