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

Unified Diff: site/try/build_sdk_json.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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: site/try/build_sdk_json.dart
diff --git a/site/try/build_sdk_json.dart b/site/try/build_sdk_json.dart
deleted file mode 100644
index ec5b56b8876b509d4230fd8e33cb3071a765f738..0000000000000000000000000000000000000000
--- a/site/try/build_sdk_json.dart
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2013, 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.
-
-import 'dart:io';
-import 'dart:convert';
-import 'package:compiler/src/util/uri_extras.dart' show relativize;
-
-main(List<String> arguments) async {
- if (arguments.length == 0) {
- print('usage: build_sdk_json.dart <out-path>');
- exit(1);
- }
-
- var out = arguments[0];
- List<Uri> sdkFiles = await collectSdkFiles();
- new File(out).writeAsStringSync(emitSdkAsJson(sdkFiles));
-}
-
-Uri sdkRoot = Uri.base.resolveUri(Platform.script).resolve('../../');
-
-/// Collects a list of files that are part of the SDK.
-List<Uri> collectSdkFiles() {
- var files = <Uri>[];
- var sdkDir = new Directory.fromUri(sdkRoot.resolve('sdk/lib/'));
- for (var entity in sdkDir.listSync(recursive: true)) {
- if (entity is File &&
- (entity.path.endsWith('.dart') || entity.path.endsWith('.platform'))) {
- files.add(entity.uri);
- }
- }
- return files;
-}
-
-/// Creates a string that encodes the contents of the sdk libraries in json.
-///
-/// The keys of the json file are sdk-relative paths to source files, and the
-/// values are the contents of the file.
-String emitSdkAsJson(List<Uri> paths) {
- var map = <String, String>{};
- for (var uri in paths) {
- String filename = relativize(sdkRoot, uri, false);
- var contents = new File.fromUri(uri).readAsStringSync();
- map['sdk:/$filename'] = contents;
- }
- return JSON.encode(map);
-}
« dart.gyp ('K') | « site/try/bugs/single_line_delete.dart ('k') | site/try/build_try.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698