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

Unified Diff: compiler/scripts/dart_analyzer.sh

Issue 9950019: Renamed the 'dartc' launch script to 'dart-analysis' and adds it to dart-sdk (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Analysis --> Analyzer Created 8 years, 9 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
Index: compiler/scripts/dart_analyzer.sh
diff --git a/compiler/scripts/dartc.sh b/compiler/scripts/dart_analyzer.sh
similarity index 55%
rename from compiler/scripts/dartc.sh
rename to compiler/scripts/dart_analyzer.sh
index dc866fc58c98ba49d674984a2e524dc9054d8409..3f4b517fae69a803d4f2999b299a5ad56fa027b7 100755
--- a/compiler/scripts/dartc.sh
+++ b/compiler/scripts/dart_analyzer.sh
@@ -1,14 +1,45 @@
#!/bin/bash --posix
-# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+# 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.
set -e
SCRIPT_DIR=$(dirname $0)
-DARTC_HOME=$(dirname $SCRIPT_DIR)
-DARTC_LIBS=$DARTC_HOME/lib
-DARTC_SDK=$(dirname $DARTC_HOME)/dart-sdk
+DART_ANALYZER_HOME=$(dirname $SCRIPT_DIR)
+DART_ANALYZER_LIBS=$DART_ANALYZER_HOME/util/analyzer
+
+FOUND_BATCH=0
+FOUND_SDK=0
+for ARG in "$@"
+do
+ case $ARG in
+ -batch|--batch)
+ FOUND_BATCH=1
+ ;;
+ --dart-sdk)
+ FOUND_SDK=1
+ ;;
+ *)
+ ;;
+ esac
+done
+
+DART_SDK=""
+if [ $FOUND_SDK = 0 ] ; then
+ if [ -f $DART_ANALYZER_HOME/lib/core/core_runtime.dart ] ; then
+ DART_SDK="--dart-sdk $DART_ANALYZER_HOME"
+ else
+ DEV_SDKDIR=$(dirname $DART_ANALYZER_HOME)/dart-sdk
scheglov 2012/04/05 13:09:51 DEV_SDK_DIR ?
zundel 2012/04/11 10:21:55 Done.
+ if [ -d $DEV_SDKDIR ] ; then
+ DART_SDK="--dart-sdk $DEV_SDKDIR"
+ else
+ echo "Couldn't find Dart SDK. Specify with --dart-sdk cmdline argument"
+ fi
+ fi
+fi
+
+
if [ -x /usr/libexec/java_home ]; then
export JAVA_HOME=$(/usr/libexec/java_home -v '1.6+')
@@ -26,21 +57,10 @@ else
# On other architectures
# -batch invocations will do better with a server vm
# invocations for analyzing a single file do better with a client vm
- FOUND_BATCH=0
- for ARG in "$@"
- do
- case $ARG in
- -batch|--batch)
- FOUND_BATCH=1
- ;;
- *)
- ;;
- esac
- done
if [ $FOUND_BATCH = 0 ] ; then
EXTRA_JVMARGS+=" -client "
fi
fi
exec java $EXTRA_JVMARGS $DART_JVMARGS -ea -classpath "@CLASSPATH@" \
- com.google.dart.compiler.DartCompiler --dart-sdk ${DARTC_SDK} $@
+ com.google.dart.compiler.DartCompiler ${DART_SDK} $@

Powered by Google App Engine
This is Rietveld 408576698