| OLD | NEW |
| (Empty) | |
| 1 #!/bin/bash |
| 2 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. |
| 5 |
| 6 set -e |
| 7 |
| 8 REPO_DIR="$(git rev-parse --show-toplevel)" |
| 9 |
| 10 # TODO(ahe): We currently rely on the Dart VM wrapper script to define |
| 11 # DART_CONFIGURATION for locating platform.dill. |
| 12 DART_VM="${REPO_DIR}/sdk/bin/dart" |
| 13 |
| 14 TOOL_DIR="${REPO_DIR}/pkg/front_end/tool/_fasta" |
| 15 |
| 16 KERNEL_BIN="${REPO_DIR}/pkg/kernel/bin" |
| 17 |
| 18 function stop { |
| 19 echo "$@" >&2 |
| 20 exit 1 |
| 21 } |
| 22 |
| 23 case "${1//_/-}" in |
| 24 abcompile) SCRIPT="${TOOL_DIR}/abcompile.dart";; |
| 25 analyzer-compile) SCRIPT="${TOOL_DIR}/analyzer_compile.dart";; |
| 26 compile) SCRIPT="${TOOL_DIR}/compile.dart";; |
| 27 compile-platform) SCRIPT="${TOOL_DIR}/compile_platform.dart";; |
| 28 compile-platform-dartk) |
| 29 SCRIPT="${TOOL_DIR}/compile_platform_dartk.dart" |
| 30 if [ "$#" != "2" ]; then |
| 31 stop "Usage: $1 file" |
| 32 fi |
| 33 ;; |
| 34 log) SCRIPT="${TOOL_DIR}/log_analyzer.dart";; |
| 35 logd) SCRIPT="${TOOL_DIR}/log_collector.dart";; |
| 36 outline) SCRIPT="${TOOL_DIR}/outline.dart";; |
| 37 parser) SCRIPT="${TOOL_DIR}/parser.dart";; |
| 38 run) SCRIPT="${TOOL_DIR}/run.dart";; |
| 39 scanner) SCRIPT="${TOOL_DIR}/scanner.dart";; |
| 40 dump-ir) |
| 41 SCRIPT="${KERNEL_BIN}/dump.dart" |
| 42 if [ "$#" = "2" ]; then |
| 43 # Write to stdout if no target is given. |
| 44 set -- "$@" /dev/fd/1 |
| 45 fi |
| 46 if [ "$#" != "3" ]; then |
| 47 stop "Usage: $1 dillfile [output]" |
| 48 fi |
| 49 ;; |
| 50 *) |
| 51 stop "'$1' isn't a valid subcommand." |
| 52 ;; |
| 53 esac |
| 54 |
| 55 shift |
| 56 |
| 57 exec "${DART_VM}" -c "${SCRIPT}" "$@" |
| OLD | NEW |