forked from firka/flutter
Unnecessary new (#20138)
* enable lint unnecessary_new * fix tests * fix tests * fix tests
This commit is contained in:
committed by
GitHub
parent
d7a0dcaa4a
commit
d927c93310
@@ -13,7 +13,7 @@ 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 engineVersion = 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');
|
||||
@@ -25,21 +25,21 @@ Future<Null> main(List<String> args) async {
|
||||
Future<Null> generateDocs(String url, String docName, String checkFile) async {
|
||||
final http.Response response = await http.get(url);
|
||||
|
||||
final Archive archive = new ZipDecoder().decodeBytes(response.bodyBytes);
|
||||
final Archive archive = ZipDecoder().decodeBytes(response.bodyBytes);
|
||||
|
||||
final Directory output = new Directory('$kDocRoot/$docName');
|
||||
final Directory output = Directory('$kDocRoot/$docName');
|
||||
print('Extracting $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}');
|
||||
final File file = File('${output.path}/${af.name}');
|
||||
file.createSync(recursive: true);
|
||||
file.writeAsBytesSync(af.content);
|
||||
}
|
||||
}
|
||||
|
||||
final File testFile = new File('${output.path}/$checkFile');
|
||||
final File testFile = File('${output.path}/$checkFile');
|
||||
if (!testFile.existsSync()) {
|
||||
print('Expected file ${testFile.path} not found');
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user