Skip to content

Commit 6873cdf

Browse files
Add a fake package that generates a link to the Android javadocs in the dartdoc output (flutter#8032)
Fixes flutter#7963
1 parent 30f3a89 commit 6873cdf

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// [Flutter platform integration APIs for Android.](https://docs.flutter.io/javadoc/)
2+
library Android;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: platform_integration
2+

dev/tools/dartdoc.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ dependencies:
3232
buf.writeln(' $package:');
3333
buf.writeln(' sdk: flutter');
3434
}
35+
buf.writeln(' platform_integration: 0.0.1');
36+
buf.writeln('dependency_overrides:');
37+
buf.writeln(' platform_integration:');
38+
buf.writeln(' path: platform_integration');
3539
new File('dev/docs/pubspec.yaml').writeAsStringSync(buf.toString());
3640

3741
// Create the library file.
@@ -67,6 +71,7 @@ dependencies:
6771
'--use-categories'
6872
];
6973

74+
7075
for (String libraryRef in libraryRefs(diskPath: true)) {
7176
args.add('--include-external');
7277
args.add(libraryRef);
@@ -134,6 +139,10 @@ void addHtmlBaseToIndex() {
134139
String indexContents = indexFile.readAsStringSync();
135140
indexContents = indexContents.replaceFirst('</title>\n',
136141
'</title>\n <base href="./flutter/">\n');
142+
indexContents = indexContents.replaceAll(
143+
'href="Android/Android-library.html"',
144+
'href="https://docs.flutter.io/javadoc/"'
145+
);
137146
indexFile.writeAsStringSync(indexContents);
138147
}
139148

@@ -175,6 +184,12 @@ Iterable<String> libraryRefs({ bool diskPath: false }) sync* {
175184
}
176185
}
177186
}
187+
188+
// Add a fake package for platform integration APIs.
189+
if (diskPath)
190+
yield 'platform_integration/lib/android.dart';
191+
else
192+
yield 'platform_integration/android.dart';
178193
}
179194

180195
void printStream(Stream<List<int>> stream) {

0 commit comments

Comments
 (0)