Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: pkg/analyzer_cli/lib/src/package_analyzer.dart

Issue 1772923002: Add an analyzer_cli option to disable analysis (for faster summary generation) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_cli/lib/src/options.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/package_analyzer.dart
diff --git a/pkg/analyzer_cli/lib/src/package_analyzer.dart b/pkg/analyzer_cli/lib/src/package_analyzer.dart
index e5692f1b490271c062582c66eb2c070b9953640c..14eebd0bb7599b78c13cc670acdc226d062d219e 100644
--- a/pkg/analyzer_cli/lib/src/package_analyzer.dart
+++ b/pkg/analyzer_cli/lib/src/package_analyzer.dart
@@ -81,11 +81,13 @@ class PackageAnalyzer {
}
context.applyChanges(changeSet);
- // Perform full analysis.
- while (true) {
- AnalysisResult analysisResult = context.performAnalysisTask();
- if (!analysisResult.hasMoreWork) {
- break;
+ if (!options.packageSummaryOnly) {
+ // Perform full analysis.
+ while (true) {
+ AnalysisResult analysisResult = context.performAnalysisTask();
+ if (!analysisResult.hasMoreWork) {
+ break;
+ }
}
}
@@ -94,7 +96,7 @@ class PackageAnalyzer {
PackageBundleAssembler assembler = new PackageBundleAssembler();
for (Source source in context.librarySources) {
if (pathos.isWithin(packageLibPath, source.fullName)) {
- LibraryElement libraryElement = context.getLibraryElement(source);
+ LibraryElement libraryElement = context.computeLibraryElement(source);
if (libraryElement != null) {
assembler.serializeLibraryElement(libraryElement);
}
@@ -106,9 +108,13 @@ class PackageAnalyzer {
file.writeAsBytesSync(sdkBundle.toBuffer(), mode: io.FileMode.WRITE_ONLY);
}
- // Process errors.
- _printErrors();
- return _computeMaxSeverity();
+ if (options.packageSummaryOnly) {
+ return ErrorSeverity.NONE;
+ } else {
+ // Process errors.
+ _printErrors();
+ return _computeMaxSeverity();
+ }
}
ErrorSeverity _computeMaxSeverity() {
« no previous file with comments | « pkg/analyzer_cli/lib/src/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698