Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: compiler/scripts/dartc_run.sh

Issue 10091038: Revert "Renamed the 'dartc' launch script to 'dart_analyzer' and adds it to dart-sdk" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiler/scripts/dartc_metrics.sh ('k') | compiler/scripts/dartc_wrapper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/scripts/dartc_run.sh
diff --git a/compiler/scripts/dartc_run.sh b/compiler/scripts/dartc_run.sh
new file mode 100755
index 0000000000000000000000000000000000000000..90f58c5b04045f27406e20a356e1086632bc7406
--- /dev/null
+++ b/compiler/scripts/dartc_run.sh
@@ -0,0 +1,61 @@
+#!/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
« no previous file with comments | « compiler/scripts/dartc_metrics.sh ('k') | compiler/scripts/dartc_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698