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

Unified Diff: lib/src/runner/runtime_utils.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 | « lib/src/runner/file_utils.dart ('k') | lib/src/runner/v8_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/runtime_utils.dart
diff --git a/lib/src/runner/runtime_utils.dart b/lib/src/runner/runtime_utils.dart
deleted file mode 100644
index c6288cc89108d41d18a78be65613833fdf3fb9e6..0000000000000000000000000000000000000000
--- a/lib/src/runner/runtime_utils.dart
+++ /dev/null
@@ -1,53 +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.
-
-/// JS runtime files utilities used by dartdevrun.
-
-import 'dart:async';
-import 'dart:io';
-
-import 'package:path/path.dart';
-
-import '../compiler.dart' show defaultRuntimeFiles;
-import '../options.dart';
-import 'file_utils.dart';
-
-/// In node.js / io.js, these modules need to be aliased globally
-/// (e.g. `var foo = require('./path/to/foo.js')`).
-/// TODO(ochafik): Investigate alternative module / alias patterns.
-const _ALIASED_RUNTIME_FILES = const {'dart_library.js': 'dart_library',};
-
-/// If [path] is a runtime file with an alias, returns that alias, otherwise
-/// returns null.
-String getRuntimeFileAlias(CompilerOptions options, File file) =>
- file.absolute.path.startsWith(_getRuntimeDir(options).absolute.path)
- ? _ALIASED_RUNTIME_FILES[basename(file.path)]
- : null;
-
-Directory _getRuntimeDir(CompilerOptions options) => new Directory(
- join(options.codegenOptions.outputDir, 'dev_compiler', 'runtime'));
-
-Future<List<File>> listOutputFiles(CompilerOptions options) async {
- List<File> files =
- await listJsFiles(new Directory(options.codegenOptions.outputDir));
-
- var runtimePath = _getRuntimeDir(options).absolute.path;
- isRuntimeFile(File file) => file.path.startsWith(runtimePath);
-
- final maxIndex = defaultRuntimeFiles.length;
- getPriorityIndex(File file) {
- if (!isRuntimeFile(file)) return maxIndex;
- int i = defaultRuntimeFiles.indexOf(basename(file.path));
- return i < 0 ? maxIndex : i;
- }
- return files
- ..sort((File a, File b) {
- int pa = getPriorityIndex(a), pb = getPriorityIndex(b);
- return pa != pb ? (pa - pb) : a.path.compareTo(b.path);
- });
-}
-
-/// TODO(ochafik): Split / reuse [AbstractCompiler.getModuleName].
-String getMainModuleName(CompilerOptions options) =>
- basename(withoutExtension(options.inputs.single));
« no previous file with comments | « lib/src/runner/file_utils.dart ('k') | lib/src/runner/v8_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698