| Index: pkg/dartino_compiler/lib/dartino_compiler.dart
|
| diff --git a/pkg/fletchc/lib/fletch_compiler.dart b/pkg/dartino_compiler/lib/dartino_compiler.dart
|
| similarity index 81%
|
| rename from pkg/fletchc/lib/fletch_compiler.dart
|
| rename to pkg/dartino_compiler/lib/dartino_compiler.dart
|
| index 2d727e004e0f1312cfa65a5d3392e348fdf03d7f..23eb517db1dc4ca4e00a622d3fe64c15499894cd 100644
|
| --- a/pkg/fletchc/lib/fletch_compiler.dart
|
| +++ b/pkg/dartino_compiler/lib/dartino_compiler.dart
|
| @@ -2,7 +2,7 @@
|
| // 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.fletch_compiler;
|
| +library dartino_compiler.dartino_compiler;
|
|
|
| import 'dart:async' show
|
| Future;
|
| @@ -28,40 +28,40 @@ import 'package:compiler/src/source_file_provider.dart' show
|
| import 'package:compiler/src/filenames.dart' show
|
| appendSlash;
|
|
|
| -import 'src/fletch_native_descriptor.dart' show
|
| - FletchNativeDescriptor;
|
| +import 'src/dartino_native_descriptor.dart' show
|
| + DartinoNativeDescriptor;
|
|
|
| -import 'src/fletch_backend.dart' show
|
| - FletchBackend;
|
| +import 'src/dartino_backend.dart' show
|
| + DartinoBackend;
|
|
|
| import 'package:compiler/src/apiimpl.dart' as apiimpl;
|
|
|
| -import 'src/fletch_compiler_implementation.dart' show
|
| - FletchCompilerImplementation,
|
| +import 'src/dartino_compiler_implementation.dart' show
|
| + DartinoCompilerImplementation,
|
| OutputProvider;
|
|
|
| -import 'fletch_system.dart';
|
| +import 'dartino_system.dart';
|
|
|
| -import 'incremental/fletchc_incremental.dart' show
|
| +import 'incremental/dartino_compiler_incremental.dart' show
|
| IncrementalCompiler,
|
| IncrementalMode;
|
|
|
| import 'src/guess_configuration.dart' show
|
| executable,
|
| - guessFletchVm;
|
| + guessDartinoVm;
|
|
|
| const String _LIBRARY_ROOT =
|
| - const String.fromEnvironment("fletchc-library-root");
|
| + const String.fromEnvironment("dartino_compiler-library-root");
|
|
|
| -const String fletchDeviceType =
|
| - const String.fromEnvironment("fletch.device-type");
|
| +const String dartinoDeviceType =
|
| + const String.fromEnvironment("dartino.device-type");
|
| const String _NATIVES_JSON =
|
| - const String.fromEnvironment("fletch-natives-json");
|
| + const String.fromEnvironment("dartino-natives-json");
|
|
|
| const String StringOrUri = "String or Uri";
|
|
|
| -class FletchCompiler {
|
| - final FletchCompilerImplementation _compiler;
|
| +class DartinoCompiler {
|
| + final DartinoCompilerImplementation _compiler;
|
|
|
| final Uri script;
|
|
|
| @@ -71,7 +71,7 @@ class FletchCompiler {
|
|
|
| final Uri nativesJson;
|
|
|
| - FletchCompiler._(
|
| + DartinoCompiler._(
|
| this._compiler,
|
| this.script,
|
| this.verbose,
|
| @@ -80,14 +80,14 @@ class FletchCompiler {
|
|
|
| Backdoor get backdoor => new Backdoor(this);
|
|
|
| - factory FletchCompiler(
|
| + factory DartinoCompiler(
|
| {CompilerInput provider,
|
| CompilerOutput outputProvider,
|
| CompilerDiagnostics handler,
|
| @StringOrUri libraryRoot,
|
| @StringOrUri packageConfig,
|
| @StringOrUri script,
|
| - @StringOrUri fletchVm,
|
| + @StringOrUri dartinoVm,
|
| @StringOrUri currentDirectory,
|
| @StringOrUri nativesJson,
|
| List<String> options,
|
| @@ -160,8 +160,8 @@ Try adding command-line option '-Ddart-sdk=<location of the Dart sdk>'.""");
|
| }
|
| }
|
|
|
| - fletchVm = guessFletchVm(
|
| - _computeValidatedUri(fletchVm, name: 'fletchVm', base: base));
|
| + dartinoVm = guessDartinoVm(
|
| + _computeValidatedUri(dartinoVm, name: 'dartinoVm', base: base));
|
|
|
| if (environment == null) {
|
| environment = <String, dynamic>{};
|
| @@ -179,7 +179,7 @@ Try adding command-line option '-Ddart-sdk=<location of the Dart sdk>'.""");
|
| throw new StateError(
|
| """
|
| Unable to guess the location of the 'natives.json' file (nativesJson).
|
| -Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| +Try adding command-line option '-Ddartino-natives-json=<path to natives.json>."""
|
| );
|
| }
|
| } else if (!_looksLikeNativesJson(nativesJson)) {
|
| @@ -187,7 +187,7 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| "[nativesJson]: natives.json not found in '$nativesJson'.");
|
| }
|
|
|
| - FletchCompilerImplementation compiler = new FletchCompilerImplementation(
|
| + DartinoCompilerImplementation compiler = new DartinoCompilerImplementation(
|
| provider,
|
| outputProvider,
|
| handler,
|
| @@ -196,19 +196,19 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| nativesJson,
|
| options,
|
| environment,
|
| - fletchVm,
|
| + dartinoVm,
|
| incrementalCompiler);
|
|
|
| compiler.log("Using library root: $libraryRoot");
|
| compiler.log("Using package config: $packageConfig");
|
|
|
| - var helper = new FletchCompiler._(
|
| + var helper = new DartinoCompiler._(
|
| compiler, script, isVerbose, platform, nativesJson);
|
| compiler.helper = helper;
|
| return helper;
|
| }
|
|
|
| - Future<FletchDelta> run([@StringOrUri script]) async {
|
| + Future<DartinoDelta> run([@StringOrUri script]) async {
|
| // TODO(ahe): Need a base argument.
|
| script = _computeValidatedUri(script, name: 'script');
|
| if (script == null) {
|
| @@ -218,7 +218,7 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| throw new StateError("No [script] provided.");
|
| }
|
| await _inititalizeContext();
|
| - FletchBackend backend = _compiler.backend;
|
| + DartinoBackend backend = _compiler.backend;
|
| return _compiler.run(script).then((_) => backend.computeDelta());
|
| }
|
|
|
| @@ -230,15 +230,15 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| }
|
| data = UTF8.decode(data);
|
| }
|
| - Map<String, FletchNativeDescriptor> natives =
|
| - <String, FletchNativeDescriptor>{};
|
| + Map<String, DartinoNativeDescriptor> natives =
|
| + <String, DartinoNativeDescriptor>{};
|
| Map<String, String> names = <String, String>{};
|
| - FletchNativeDescriptor.decode(data, natives, names);
|
| + DartinoNativeDescriptor.decode(data, natives, names);
|
| _compiler.context.nativeDescriptors = natives;
|
| _compiler.context.setNames(names);
|
| }
|
|
|
| - Uri get fletchVm => _compiler.fletchVm;
|
| + Uri get dartinoVm => _compiler.dartinoVm;
|
|
|
| /// Create a new instance of [IncrementalCompiler].
|
| IncrementalCompiler newIncrementalCompiler(
|
| @@ -247,7 +247,7 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| return new IncrementalCompiler(
|
| libraryRoot: _compiler.libraryRoot,
|
| packageConfig: _compiler.packageConfig,
|
| - fletchVm: _compiler.fletchVm,
|
| + dartinoVm: _compiler.dartinoVm,
|
| nativesJson: _compiler.nativesJson,
|
| inputProvider: _compiler.provider,
|
| diagnosticHandler: _compiler.handler,
|
| @@ -264,11 +264,11 @@ Try adding command-line option '-Dfletch-natives-json=<path to natives.json>."""
|
| // be part of the API of this file.
|
| // TODO(ahe): Delete this class.
|
| class Backdoor {
|
| - final FletchCompiler _compiler;
|
| + final DartinoCompiler _compiler;
|
|
|
| Backdoor(this._compiler);
|
|
|
| - Future<FletchCompilerImplementation> get compilerImplementation async {
|
| + Future<DartinoCompilerImplementation> get compilerImplementation async {
|
| await _compiler._inititalizeContext();
|
| return _compiler._compiler;
|
| }
|
| @@ -319,13 +319,13 @@ Uri _computeValidatedUri(
|
| }
|
|
|
| Uri _guessLibraryRoot(String platform) {
|
| - // When running from fletch, [executable] is
|
| - // ".../fletch-repo/fletch/out/$CONFIGURATION/dart", which means that the
|
| - // fletch root is the lib directory in the 2th parent directory (due to
|
| + // When running from dartino, [executable] is
|
| + // ".../dartino-repo/sdk/out/$CONFIGURATION/dart", which means that the
|
| + // dartino root is the lib directory in the 2th parent directory (due to
|
| // how URI resolution works, the filename ("dart") is removed before
|
| // resolving, for example,
|
| - // ".../fletch-repo/fletch/out/$CONFIGURATION/../../" becomes
|
| - // ".../fletch-repo/fletch/").
|
| + // ".../dartino-repo/sdk/out/$CONFIGURATION/../../" becomes
|
| + // ".../dartino-repo/sdk/").
|
| Uri guess = executable.resolve('../../lib/');
|
| if (_looksLikeLibraryRoot(guess, platform)) return guess;
|
| return null;
|
|
|