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

Unified Diff: dart/pkg/compiler/samples/darttags/darttags.dart

Issue 794253002: Customize which libraries darttags index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/samples/darttags/darttags.dart
diff --git a/dart/pkg/compiler/samples/darttags/darttags.dart b/dart/pkg/compiler/samples/darttags/darttags.dart
index a62b6189bccf5647c0b3e5513694ec1f44ab977e..c44cdf092df1a0e93863d04ab5647a3f17a00d50 100644
--- a/dart/pkg/compiler/samples/darttags/darttags.dart
+++ b/dart/pkg/compiler/samples/darttags/darttags.dart
@@ -13,7 +13,10 @@
// # Replace "xcodebuild" with "out" on Linux, and "build" on Windows.
// "-pdart/xcodebuild/ReleaseIA32/packages/",
// "dart/pkg/compiler/samples/darttags/darttags.dart",
-// "dart/TAGS"
+// "dart/TAGS",
+// # Modify the following list to your preferences:
+// "dart/tests/try/web/incremental_compilation_update_test.dart",
+// "package:compiler/src/dart2js.dart",
// ],
// },
// ]
@@ -43,8 +46,8 @@ import 'package:compiler/src/source_file.dart';
import 'package:compiler/src/source_file_provider.dart';
import 'package:compiler/src/util/uri_extras.dart';
-const DART2JS = '../../lib/src/dart2js.dart';
-const DART2JS_MIRROR = '../../lib/src/mirrors/dart2js_mirrors.dart';
+const DART2JS = 'package:compiler/src/dart2js.dart';
+const DART2JS_MIRROR = 'package:compiler/src/mirrors/dart2js_mirrors.dart';
const SDK_ROOT = '../../../../sdk/';
bool isPublicDart2jsLibrary(String name) {
@@ -66,15 +69,23 @@ main(List<String> arguments) {
Uri myLocation =
handler.provider.cwd.resolveUri(Platform.script);
+ List<Uri> uris = <Uri>[];
+
+ if (arguments.length > 1) {
+ // Compute tags for libraries requested by the user.
+ uris.addAll(
+ arguments.skip(1).map((argument) => Uri.base.resolve(argument)));
+ } else {
+ // Compute tags for dart2js itself.
+ uris.add(myLocation.resolve(DART2JS));
+ uris.add(myLocation.resolve(DART2JS_MIRROR));
+ }
+
// Get the names of public dart2js libraries.
Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
// Prepend "dart:" to the names.
- List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
-
- // Append dart2js itself.
- uris.add(myLocation.resolve(DART2JS));
- uris.add(myLocation.resolve(DART2JS_MIRROR));
+ uris.addAll(names.map((String name) => Uri.parse('dart:$name')));
Uri libraryRoot = myLocation.resolve(SDK_ROOT);
Uri packageRoot = Uri.base.resolve(Platform.packageRoot);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698