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

Unified Diff: analyzer/lib/src/task/general.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « analyzer/lib/src/task/driver.dart ('k') | analyzer/lib/src/task/html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: analyzer/lib/src/task/general.dart
diff --git a/analyzer/lib/src/task/general.dart b/analyzer/lib/src/task/general.dart
deleted file mode 100644
index 72f80fde5520670f3e84aefe28a43880c135945f..0000000000000000000000000000000000000000
--- a/analyzer/lib/src/task/general.dart
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer.src.task.general;
-
-import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/task/general.dart';
-import 'package:analyzer/task/model.dart';
-
-/**
- * A task that gets the contents of the source associated with an analysis
- * target.
- */
-class GetContentTask extends SourceBasedAnalysisTask {
- /**
- * The task descriptor describing this kind of task.
- */
- static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('GetContentTask',
- createTask, buildInputs, <ResultDescriptor>[CONTENT, MODIFICATION_TIME]);
-
- /**
- * Initialize a newly created task to access the content of the source
- * associated with the given [target] in the given [context].
- */
- GetContentTask(AnalysisContext context, AnalysisTarget target)
- : super(context, target);
-
- @override
- TaskDescriptor get descriptor => DESCRIPTOR;
-
- @override
- internalPerform() {
- Source source = getRequiredSource();
- try {
- TimestampedData<String> data = context.getContents(source);
- outputs[CONTENT] = data.data;
- outputs[MODIFICATION_TIME] = data.modificationTime;
- } catch (exception) {
- outputs[CONTENT] = '';
- outputs[MODIFICATION_TIME] = -1;
- }
- }
-
- /**
- * Return a map from the names of the inputs of this kind of task to the task
- * input descriptors describing those inputs for a task with the given [target].
- */
- static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
- return <String, TaskInput>{};
- }
-
- /**
- * Create a [GetContentTask] based on the given [target] in the given
- * [context].
- */
- static GetContentTask createTask(
- AnalysisContext context, AnalysisTarget target) {
- return new GetContentTask(context, target);
- }
-}
-
-/**
- * A base class for analysis tasks whose target is expected to be a source.
- */
-abstract class SourceBasedAnalysisTask extends AnalysisTask {
- /**
- * Initialize a newly created task to perform analysis within the given
- * [context] in order to produce results for the given [target].
- */
- SourceBasedAnalysisTask(AnalysisContext context, AnalysisTarget target)
- : super(context, target);
-
- @override
- String get description {
- Source source = target.source;
- String sourceName = source == null ? '<unknown source>' : source.fullName;
- return '${descriptor.name} for source $sourceName';
- }
-}
« no previous file with comments | « analyzer/lib/src/task/driver.dart ('k') | analyzer/lib/src/task/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698