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

Unified Diff: pkg/analyzer/lib/src/task/targets.dart

Issue 812733004: Initial task support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
Index: pkg/analyzer/lib/src/task/targets.dart
diff --git a/pkg/analyzer/lib/src/task/targets.dart b/pkg/analyzer/lib/src/task/targets.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8c55f51cbdb631d8b5652acafbe42f1e7c09cd97
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/targets.dart
@@ -0,0 +1,31 @@
+// 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.targets;
+
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/task/model.dart';
+
+/**
+ * A `SourceTarget` is a [Source] that can be used as an [AnalysisTarget].
+ */
+class SourceTarget implements AnalysisTarget {
+ /**
+ * The source being represented as a target.
+ */
+ final Source source;
+
+ /**
+ * Initialize a newly created target to represent the given [source].
+ */
+ SourceTarget(this.source);
+
+ @override
+ int get hashCode => source.hashCode;
+
+ @override
+ bool operator ==(Object object) {
+ return object is SourceTarget && object.source == source;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698