Files
sdk/compiler/scripts/dartc_run.sh
T
zundel@google.com 4ce241dc76 Revert "Renamed the 'dartc' launch script to 'dart_analyzer' and adds it to dart-sdk"
This reverts r6629.  Breaks the windows editor build in a different way.

Review URL: https://chromiumcodereview.appspot.com//10091038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6633 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 13:26:54 +00:00

62 lines
1.7 KiB
Bash
Executable File

#!/bin/bash --posix
#
# Copyright (c) 2012, 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.
# Prevent problems where the caller has exported CLASSPATH, causing our
# computed value to be copied into the environment and double-counted
# against the argv limit.
unset CLASSPATH
# Figure out where the dartc home is
SCRIPT_DIR=`dirname $0`
DARTC_HOME=`cd $SCRIPT_DIR; pwd`
DARTC_LIBS=$DIST_DIR/lib
DIST_DIR=$DARTC_HOME/compiler
DARTC_FLAGS=""
# Make it easy to insert 'set -x' or similar commands when debugging problems with this script.
eval "$JAVA_STUB_DEBUG"
JVM_FLAGS_CMDLINE=""
while [ ! -z "$1" ]; do
case "$1" in
--prof)
# Ensure the preset -optimize flag is gone when profiling.
DARTC_FLAGS="--prof"
shift ;;
--debug)
JVM_DEBUG_PORT=${DEFAULT_JVM_DEBUG_PORT:-"5005"}
shift ;;
--debug=*)
JVM_DEBUG_PORT=${1/--debug=/}
shift ;;
--jvm_flags=*)
JVM_FLAGS_CMDLINE="$JVM_FLAGS_CMDLINE ${1/--jvm_flags=/}"
shift ;;
*) break ;;
esac
done
if [ "$JVM_DEBUG_PORT" != "" ]; then
JVM_DEBUG_SUSPEND=${DEFAULT_JVM_DEBUG_SUSPEND:-"y"}
JVM_DEBUG_FLAGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=${JVM_DEBUG_SUSPEND},address=${JVM_DEBUG_PORT}"
fi
shopt -s execfail # Return control to this script if exec fails.
exec $JAVABIN -ea -classpath @CLASSPATH@ \
${JVM_DEBUG_FLAGS} \
${JVM_FLAGS} \
${JVM_FLAGS_CMDLINE} \
com.google.dart.compiler.DartCompiler \
$DARTC_FLAGS \
"$@"
echo "ERROR: couldn't exec ${JAVABIN}." 1>&2
exit 1