8e166e93d3
Change-Id: I305f2d2e5ae85b17c99c29fc6e2816943d68e46c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497540 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
63 lines
1.7 KiB
Bash
Executable File
63 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) 2017, 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.
|
|
|
|
# There is a cfe.dart script in the same directory as this script. Prefer
|
|
# to use that since it is a Dart script and can be run in any environment.
|
|
|
|
set -e
|
|
|
|
REPO_DIR="$(cd ${BASH_SOURCE%/*} && git rev-parse --show-toplevel)"
|
|
|
|
DART_VM=${DART_VM-"${REPO_DIR}/sdk/bin/dart"}
|
|
|
|
TOOL_DIR="${REPO_DIR}/pkg/front_end/tool"
|
|
|
|
KERNEL_BIN="${REPO_DIR}/pkg/kernel/bin"
|
|
|
|
function stop {
|
|
echo "$@" >&2
|
|
exit 2
|
|
}
|
|
|
|
EXTRA_VM_ARGS=()
|
|
|
|
while [[ "$1" == -* ]]; do
|
|
EXTRA_VM_ARGS+=("$1")
|
|
shift
|
|
done
|
|
|
|
case "${1//_/-}" in
|
|
abcompile) SCRIPT="${TOOL_DIR}/abcompile.dart";;
|
|
compile) SCRIPT="${TOOL_DIR}/compile.dart";;
|
|
compile-platform) SCRIPT="${TOOL_DIR}/compile_platform.dart";;
|
|
log) SCRIPT="${TOOL_DIR}/log_analyzer.dart";;
|
|
outline) SCRIPT="${TOOL_DIR}/outline.dart";;
|
|
parser) SCRIPT="${TOOL_DIR}/parser.dart";;
|
|
scanner) SCRIPT="${TOOL_DIR}/scanner.dart";;
|
|
dump-ir)
|
|
SCRIPT="${KERNEL_BIN}/dump.dart"
|
|
if [ "$#" = "2" ]; then
|
|
# Write to stdout if no target is given.
|
|
set -- "$@" /dev/fd/1
|
|
fi
|
|
if [ "$#" != "3" ]; then
|
|
stop "Usage: $1 dillFile [output]"
|
|
fi
|
|
;;
|
|
testing)
|
|
SCRIPT="${REPO_DIR}/pkg/testing/bin/testing.dart"
|
|
set -- "$@" "--config=${REPO_DIR}/pkg/front_end/testing.json"
|
|
;;
|
|
generate-messages) SCRIPT="${TOOL_DIR}/generate_messages.dart";;
|
|
generate-experimental-flags) SCRIPT="${TOOL_DIR}/generate_experimental_flags.dart";;
|
|
*)
|
|
stop "'$1' isn't a valid subcommand."
|
|
;;
|
|
esac
|
|
|
|
shift
|
|
|
|
exec "${DART_VM}" "${EXTRA_VM_ARGS[@]}" --enable-asserts "${SCRIPT}" "$@"
|