mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* Update project.pbxproj files to say Flutter rather than Chromium Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright. * Update the copyright notice checker to require a standard notice on all files * Update copyrights on Dart files. (This was a mechanical commit.) * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine. Some were already marked "The Flutter Authors", not clear why. Their dates have been normalized. Some were missing the blank line after the license. Some were randomly different in trivial ways for no apparent reason (e.g. missing the trailing period). * Clean up the copyrights in non-Dart files. (Manual edits.) Also, make sure templates don't have copyrights. * Fix some more ORGANIZATIONNAMEs
71 lines
2.9 KiB
Dart
71 lines
2.9 KiB
Dart
// Copyright 2014 The Flutter 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:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter_devicelab/framework/framework.dart';
|
|
import 'package:flutter_devicelab/framework/utils.dart';
|
|
import 'package:path/path.dart' as path;
|
|
|
|
Future<void> main() async {
|
|
final String dot = Platform.isWindows ? '-' : '•';
|
|
await task(() async {
|
|
final Stopwatch clock = Stopwatch()..start();
|
|
final Process analysis = await startProcess(
|
|
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
|
<String>['analyze', '--no-preamble', '--flutter-repo', '--dartdocs'],
|
|
workingDirectory: flutterDirectory.path,
|
|
);
|
|
int publicMembers = 0;
|
|
int otherErrors = 0;
|
|
int otherLines = 0;
|
|
bool sawFinalLine = false;
|
|
await for (String entry in analysis.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
|
entry = entry.trim();
|
|
print('analyzer stdout: $entry');
|
|
if (entry == 'Building flutter tool...') {
|
|
// ignore this line
|
|
} else if (entry.startsWith('info $dot Document all public members $dot')) {
|
|
publicMembers += 1;
|
|
} else if (entry.startsWith('info $dot') || entry.startsWith('warning $dot') || entry.startsWith('error $dot')) {
|
|
otherErrors += 1;
|
|
} else if (entry.contains(' (ran in ') && !sawFinalLine) {
|
|
// ignore this line once
|
|
sawFinalLine = true;
|
|
} else if (entry.isNotEmpty) {
|
|
otherLines += 1;
|
|
print('^ not sure what to do with that line ^');
|
|
}
|
|
}
|
|
await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
|
print('analyzer stderr: $entry');
|
|
if (entry.contains(' (ran in ') && !sawFinalLine) {
|
|
// ignore this line once
|
|
sawFinalLine = true;
|
|
} else {
|
|
otherLines += 1;
|
|
print('^ not sure what to do with that line ^');
|
|
}
|
|
}
|
|
final int result = await analysis.exitCode;
|
|
clock.stop();
|
|
if (!sawFinalLine)
|
|
throw Exception('flutter analyze did not output final message');
|
|
if (publicMembers == 0 && otherErrors == 0 && result != 0)
|
|
throw Exception('flutter analyze exited with unexpected error code $result');
|
|
if (publicMembers != 0 && otherErrors != 0 && result == 0)
|
|
throw Exception('flutter analyze exited with successful status code despite reporting errors');
|
|
if (otherLines != 0)
|
|
throw Exception('flutter analyze had unexpected output (we saw $otherLines unexpected line${ otherLines == 1 ? "" : "s" })');
|
|
final Map<String, dynamic> data = <String, dynamic>{
|
|
'members_missing_dartdocs': publicMembers,
|
|
'analysis_errors': otherErrors,
|
|
'elapsed_time_ms': clock.elapsedMilliseconds,
|
|
};
|
|
return TaskResult.success(data, benchmarkScoreKeys: data.keys.toList());
|
|
});
|
|
}
|