Add objc doc to the dartdoc output (#10905)
This commit is contained in:
parent
f946171817
commit
d97b13b5fd
@ -14,7 +14,7 @@ bin/cache/dart-sdk/bin/pub global activate dartdoc 0.13.0+1
|
|||||||
# a custom index.html, placing everything into dev/docs/doc.
|
# a custom index.html, placing everything into dev/docs/doc.
|
||||||
(cd dev/tools; ../../bin/cache/dart-sdk/bin/pub get)
|
(cd dev/tools; ../../bin/cache/dart-sdk/bin/pub get)
|
||||||
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart
|
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart
|
||||||
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/javadoc.dart
|
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/java_and_objc_doc.dart
|
||||||
|
|
||||||
# Ensure google webmaster tools can verify our site.
|
# Ensure google webmaster tools can verify our site.
|
||||||
cp dev/docs/google2ed1af765c529f57.html dev/docs/doc
|
cp dev/docs/google2ed1af765c529f57.html dev/docs/doc
|
||||||
|
2
dev/docs/platform_integration/lib/ios.dart
Normal file
2
dev/docs/platform_integration/lib/ios.dart
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/// [Flutter platform integration APIs for iOS.](https://docs.flutter.io/objcdoc/)
|
||||||
|
library iOS;
|
@ -200,6 +200,11 @@ void addHtmlBaseToIndex() {
|
|||||||
'href="Android/Android-library.html"',
|
'href="Android/Android-library.html"',
|
||||||
'href="https://docs.flutter.io/javadoc/"'
|
'href="https://docs.flutter.io/javadoc/"'
|
||||||
);
|
);
|
||||||
|
indexContents = indexContents.replaceAll(
|
||||||
|
'href="iOS/iOS-library.html"',
|
||||||
|
'href="https://docs.flutter.io/objc/"'
|
||||||
|
);
|
||||||
|
|
||||||
indexFile.writeAsStringSync(indexContents);
|
indexFile.writeAsStringSync(indexContents);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,10 +248,13 @@ Iterable<String> libraryRefs({ bool diskPath: false }) sync* {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add a fake package for platform integration APIs.
|
// Add a fake package for platform integration APIs.
|
||||||
if (diskPath)
|
if (diskPath) {
|
||||||
yield 'platform_integration/lib/android.dart';
|
yield 'platform_integration/lib/android.dart';
|
||||||
else
|
yield 'platform_integration/lib/ios.dart';
|
||||||
|
} else {
|
||||||
yield 'platform_integration/android.dart';
|
yield 'platform_integration/android.dart';
|
||||||
|
yield 'platform_integration/ios.dart';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void printStream(Stream<List<int>> stream) {
|
void printStream(Stream<List<int>> stream) {
|
||||||
|
53
dev/tools/java_and_objc_doc.dart
Normal file
53
dev/tools/java_and_objc_doc.dart
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:archive/archive.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
|
const String kDocRoot = 'dev/docs/doc';
|
||||||
|
|
||||||
|
/// This script downloads an archive of Javadoc and objc doc for the engine from
|
||||||
|
/// the artifact store and extracts them to the location used for Dartdoc.
|
||||||
|
Future<Null> main(List<String> args) async {
|
||||||
|
final String engineVersion =
|
||||||
|
new File('bin/internal/engine.version').readAsStringSync().trim();
|
||||||
|
|
||||||
|
final String javadocUrl =
|
||||||
|
'https://storage.googleapis.com/flutter_infra/flutter/$engineVersion/android-javadoc.zip';
|
||||||
|
generateDocs(javadocUrl, 'javadoc', 'io/flutter/view/FlutterView.html');
|
||||||
|
|
||||||
|
final String objcdocUrl =
|
||||||
|
'https://storage.googleapis.com/flutter_infra/flutter/$engineVersion/ios-objcdoc.zip';
|
||||||
|
generateDocs(
|
||||||
|
objcdocUrl, 'objcdoc', 'objc/Classes/FlutterViewController.html');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Null> generateDocs(
|
||||||
|
final String url, String docName, String checkFile) async {
|
||||||
|
final http.Response response = await http.get(url);
|
||||||
|
|
||||||
|
final Archive archive = new ZipDecoder().decodeBytes(response.bodyBytes);
|
||||||
|
|
||||||
|
final Directory output = new Directory('$kDocRoot/$docName');
|
||||||
|
print('Extracing $docName to ${output.path}');
|
||||||
|
output.createSync(recursive: true);
|
||||||
|
|
||||||
|
for (ArchiveFile af in archive) {
|
||||||
|
if (af.isFile) {
|
||||||
|
final File file = new File('${output.path}/${af.name}');
|
||||||
|
file.createSync(recursive: true);
|
||||||
|
file.writeAsBytesSync(af.content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final File testFile = new File('${output.path}/$checkFile');
|
||||||
|
if (!testFile.existsSync()) {
|
||||||
|
print('Expected file ${testFile.path} not found');
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
print('$docName ready to go!');
|
||||||
|
}
|
@ -1,41 +0,0 @@
|
|||||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:archive/archive.dart';
|
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
|
|
||||||
const String kDocRoot = 'dev/docs/doc';
|
|
||||||
|
|
||||||
/// This script downloads an archive of Javadoc for the engine from the
|
|
||||||
/// artifact store and extracts it to the location used for Dartdoc.
|
|
||||||
Future<Null> main(List<String> args) async {
|
|
||||||
final String engineVersion = new File('bin/internal/engine.version').readAsStringSync().trim();
|
|
||||||
|
|
||||||
final String url = 'https://storage.googleapis.com/flutter_infra/flutter/$engineVersion/android-javadoc.zip';
|
|
||||||
final http.Response response = await http.get(url);
|
|
||||||
|
|
||||||
final Archive archive = new ZipDecoder().decodeBytes(response.bodyBytes);
|
|
||||||
|
|
||||||
final Directory output = new Directory('$kDocRoot/javadoc');
|
|
||||||
print('Extracing javadoc to ${output.path}');
|
|
||||||
output.createSync(recursive: true);
|
|
||||||
|
|
||||||
for (ArchiveFile af in archive) {
|
|
||||||
if (af.isFile) {
|
|
||||||
final File file = new File('${output.path}/${af.name}');
|
|
||||||
file.createSync(recursive: true);
|
|
||||||
file.writeAsBytesSync(af.content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final File testFile = new File('${output.path}/io/flutter/view/FlutterView.html');
|
|
||||||
if (!testFile.existsSync()) {
|
|
||||||
print('Expected file ${testFile.path} not found');
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
print('Javadocs ready to go!');
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user