16aa720d27
This separates compiling platform.dill files from the patch_sdk.dart script. The motivation for that is that I'm working on reading patch files directly from Fasta, so we can completely remove the build step for generating patched_sdk and dart2js_patched_sdk. Short-term this should allow Paul to add a strong-mode version of platform.dill without causing to many conflicts with my work on patches. Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54 Reviewed-on: https://dart-review.googlesource.com/11506 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
74 lines
2.1 KiB
Bash
Executable File
74 lines
2.1 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.
|
|
|
|
# TODO(ahe): This should be replaced by a Dart script that works on Windows,
|
|
# Linux, and Mac.
|
|
|
|
set -e
|
|
|
|
REPO_DIR="$(cd ${BASH_SOURCE%/*} && git rev-parse --show-toplevel)"
|
|
|
|
DART_VM="${REPO_DIR}/sdk/bin/dart"
|
|
|
|
TOOL_DIR="${REPO_DIR}/pkg/front_end/tool/_fasta"
|
|
|
|
KERNEL_BIN="${REPO_DIR}/pkg/kernel/bin"
|
|
|
|
function stop {
|
|
echo "$@" >&2
|
|
exit 2
|
|
}
|
|
|
|
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
|
|
|
|
case "${1//_/-}" in
|
|
abcompile) SCRIPT="${TOOL_DIR}/abcompile.dart";;
|
|
analyzer-compile)
|
|
stop "'$1' isn't supported anymore, please use 'compile' instead."
|
|
;;
|
|
compile) SCRIPT="${TOOL_DIR}/compile.dart";;
|
|
compile-platform) SCRIPT="${TOOL_DIR}/compile_platform.dart";;
|
|
log) SCRIPT="${TOOL_DIR}/log_analyzer.dart";;
|
|
logd) SCRIPT="${TOOL_DIR}/log_collector.dart";;
|
|
outline) SCRIPT="${TOOL_DIR}/outline.dart";;
|
|
parser) SCRIPT="${TOOL_DIR}/parser.dart";;
|
|
run)
|
|
stop "'$1' isn't supported anymore, please use 'kernel-service' instead."
|
|
;;
|
|
scanner) SCRIPT="${TOOL_DIR}/scanner.dart";;
|
|
dump-partial) SCRIPT="${TOOL_DIR}/dump_partial.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
|
|
;;
|
|
kernel-service)
|
|
shift
|
|
PATCHED_SDK_DIR=$(
|
|
ls -d {xcodebuild,out}/${DART_CONFIGURATION} 2>/dev/null \
|
|
| head -1)
|
|
exec "${DART_VM}" -DDFE_VERBOSE=true \
|
|
--kernel-binaries=${PATCHED_SDK_DIR} \
|
|
--dfe="${REPO_DIR}/utils/kernel-service/kernel-service.dart" "$@"
|
|
;;
|
|
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";;
|
|
*)
|
|
stop "'$1' isn't a valid subcommand."
|
|
;;
|
|
esac
|
|
|
|
shift
|
|
|
|
exec "${DART_VM}" -c "${SCRIPT}" "$@"
|