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

Unified Diff: pkg/fletchc/lib/src/guess_configuration.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 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
« no previous file with comments | « pkg/fletchc/lib/src/function_codegen.dart ('k') | pkg/fletchc/lib/src/hub/client_commands.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fletchc/lib/src/guess_configuration.dart
diff --git a/pkg/fletchc/lib/src/guess_configuration.dart b/pkg/fletchc/lib/src/guess_configuration.dart
deleted file mode 100644
index cad046d3ee348bcccd5e78b6d64e42637ef68335..0000000000000000000000000000000000000000
--- a/pkg/fletchc/lib/src/guess_configuration.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2015, the Dartino 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.md file.
-
-library fletchc.src.guess_configuration;
-
-import 'dart:io' show
- File,
- Link,
- Platform,
- Process;
-
-const String _FLETCH_VM = const String.fromEnvironment("fletch-vm");
-
-Uri get executable {
- return Uri.base.resolveUri(new Uri.file(Platform.resolvedExecutable));
-}
-
-bool _looksLikeFletchVm(Uri uri) {
- return new File.fromUri(uri).existsSync();
-}
-
-// TODO(zerny): Guessing the VM path should only happen once and only if no
-// prior configuration has happend. Make this a private method in
-// fletch_compiler.dart
-Uri guessFletchVm(Uri fletchVm, {bool mustExist: true}) {
- if (fletchVm == null && _FLETCH_VM != null) {
- // Use Uri.base here because _FLETCH_VM is a constant relative to the
- // location of where the Dart VM was started, not relative to the C++
- // client.
- fletchVm = Uri.base.resolve(_FLETCH_VM);
- } else {
- Uri uri = executable.resolve('fletch-vm');
- if (new File.fromUri(uri).existsSync()) {
- fletchVm = uri;
- }
- }
- if (fletchVm == null) {
- if (!mustExist) return null;
- throw new StateError("""
-Unable to guess the location of the fletch VM (fletchVm).
-Try adding command-line option '-Dfletch-vm=<path to fletch VM>.""");
- } else if (!_looksLikeFletchVm(fletchVm)) {
- if (!mustExist) return null;
- throw new StateError("""
-No fletch VM at '$fletchVm'.
-Try adding command-line option '-Dfletch-vm=<path to fletch VM>.""");
- }
- return fletchVm;
-}
-
-String _cachedFletchVersion;
-
-String get fletchVersion {
- if (_cachedFletchVersion != null) return _cachedFletchVersion;
- _cachedFletchVersion = const String.fromEnvironment('fletch.version');
- if (_cachedFletchVersion != null) return _cachedFletchVersion;
- Uri fletchVm = guessFletchVm(null, mustExist: false);
- if (fletchVm != null) {
- String vmPath = fletchVm.toFilePath();
- return _cachedFletchVersion =
- Process.runSync(vmPath, <String>["--version"]).stdout.trim();
- }
- return _cachedFletchVersion = "version information not available";
-}
« no previous file with comments | « pkg/fletchc/lib/src/function_codegen.dart ('k') | pkg/fletchc/lib/src/hub/client_commands.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698