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

Unified Diff: pkg/analyzer/lib/src/summary/summary_file_builder.dart

Issue 2078033002: Introduce build configuration to summary building. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | pkg/analyzer/tool/summary/build_sdk_summaries.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summary_file_builder.dart
diff --git a/pkg/analyzer/lib/src/summary/summary_file_builder.dart b/pkg/analyzer/lib/src/summary/summary_file_builder.dart
index d4097706616456c7d461889b11b6ba088fb9b15f..c4b9e6b1ae124bf402e63f000f100444dc988e68 100644
--- a/pkg/analyzer/lib/src/summary/summary_file_builder.dart
+++ b/pkg/analyzer/lib/src/summary/summary_file_builder.dart
@@ -46,13 +46,70 @@ class BuilderOutput {
}
}
+/**
+ * Summary build configuration.
+ */
+class SummaryBuildConfig {
+
+ /**
+ * Whether to use exclude informative data from created summaries.
+ */
+ final bool buildSummaryExcludeInformative;
+
+ /**
+ * Whether to output a summary in "fallback mode".
+ */
+ final bool buildSummaryFallback;
+ /**
Paul Berry 2016/06/17 19:57:51 Nit: add a blank line here.
pquitslund 2016/06/17 20:47:32 Done.
+ * Whether to create summaries using only ASTs, i.e. don't perform resolution.
Paul Berry 2016/06/17 19:57:51 Technically, creating summaries from ASTs performs
pquitslund 2016/06/17 20:47:32 Done.
+ */
+ final bool buildSummaryOnlyAst;
+
+ /**
+ * Path to the dart SDK summary file.
+ */
+ final String dartSdkSummaryPath;
+
+ /**
+ * Whether to use strong static checking.
+ */
+ final bool strongMode;
+
+ /**
+ * List of summary input file paths.
+ */
+ final Iterable<String> summaryInputs;
+
+ /**
+ * Create a build configuration with the given set options.
+ */
+ SummaryBuildConfig(
+ {this.strongMode: false,
+ this.summaryInputs,
+ this.dartSdkSummaryPath,
+ this.buildSummaryExcludeInformative: false,
+ this.buildSummaryFallback: false,
+ this.buildSummaryOnlyAst: false});
+}
+
class SummaryBuilder {
- final AnalysisContext _context;
- final Iterable<Source> _librarySources;
+ final AnalysisContext context;
+ final Iterable<Source> librarySources;
+ final SummaryBuildConfig config;
- SummaryBuilder(this._librarySources, this._context);
+ /**
+ * Create a summary builder for these [librarySources] and [context] using the
+ * given [config].
+ */
+ SummaryBuilder(this.librarySources, this.context, this.config);
+
+ /**
+ * Create an SDK summary builder for the dart SDK at the given [sdkPath],
+ * using this [config].
+ */
+ factory SummaryBuilder.forSdk(String sdkPath, SummaryBuildConfig config) {
+ bool strongMode = config.strongMode;
- factory SummaryBuilder.forSdk(String sdkPath, bool strongMode) {
//
// Prepare SDK.
//
@@ -76,10 +133,10 @@ class SummaryBuilder {
librarySources.add(sdk.mapDartUri(uri));
}
- return new SummaryBuilder(librarySources, sdk.context);
+ return new SummaryBuilder(librarySources, sdk.context, config);
}
- BuilderOutput build() => new _Builder(_context, _librarySources).build();
+ BuilderOutput build() => new _Builder(context, librarySources).build();
}
/**
@@ -123,7 +180,7 @@ class _Builder {
_Builder(this.context, this.librarySources);
/**
- * Build a strong or spec mode summary for the Dart SDK at [sdkPath].
+ * Build summary output.
*/
BuilderOutput build() {
//
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/build_sdk_summaries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698