mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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:
parent
30f3a896e6
commit
6873cdfe30
2
dev/docs/platform_integration/lib/android.dart
Normal file
2
dev/docs/platform_integration/lib/android.dart
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/// [Flutter platform integration APIs for Android.](https://docs.flutter.io/javadoc/)
|
||||||
|
library Android;
|
2
dev/docs/platform_integration/pubspec.yaml
Normal file
2
dev/docs/platform_integration/pubspec.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
name: platform_integration
|
||||||
|
|
@ -32,6 +32,10 @@ dependencies:
|
|||||||
buf.writeln(' $package:');
|
buf.writeln(' $package:');
|
||||||
buf.writeln(' sdk: flutter');
|
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());
|
new File('dev/docs/pubspec.yaml').writeAsStringSync(buf.toString());
|
||||||
|
|
||||||
// Create the library file.
|
// Create the library file.
|
||||||
@ -67,6 +71,7 @@ dependencies:
|
|||||||
'--use-categories'
|
'--use-categories'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
for (String libraryRef in libraryRefs(diskPath: true)) {
|
for (String libraryRef in libraryRefs(diskPath: true)) {
|
||||||
args.add('--include-external');
|
args.add('--include-external');
|
||||||
args.add(libraryRef);
|
args.add(libraryRef);
|
||||||
@ -134,6 +139,10 @@ void addHtmlBaseToIndex() {
|
|||||||
String indexContents = indexFile.readAsStringSync();
|
String indexContents = indexFile.readAsStringSync();
|
||||||
indexContents = indexContents.replaceFirst('</title>\n',
|
indexContents = indexContents.replaceFirst('</title>\n',
|
||||||
'</title>\n <base href="./flutter/">\n');
|
'</title>\n <base href="./flutter/">\n');
|
||||||
|
indexContents = indexContents.replaceAll(
|
||||||
|
'href="Android/Android-library.html"',
|
||||||
|
'href="https://docs.flutter.io/javadoc/"'
|
||||||
|
);
|
||||||
indexFile.writeAsStringSync(indexContents);
|
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) {
|
void printStream(Stream<List<int>> stream) {
|
||||||
|
Loading…
Reference in New Issue
Block a user