Index: editor/tools/analyzer_experimental |
diff --git a/editor/tools/analyzer_experimental b/editor/tools/analyzer_experimental |
new file mode 100755 |
index 0000000000000000000000000000000000000000..26f46cd3763109e85dd49b50227459d6a643058f |
--- /dev/null |
+++ b/editor/tools/analyzer_experimental |
@@ -0,0 +1,44 @@ |
+#!/bin/bash --posix |
ahe
2013/06/12 13:21:19
What is the --posix option for?
kustermann
2013/06/12 13:37:07
Left over from old dart2analyzer script. Should no
|
+# Copyright (c) 2013, 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 |
+ |
+CUR_DIR="$(cd "${BASH_SOURCE%/*}" ; pwd -P)" |
ahe
2013/06/12 13:21:19
Is ${BASH_SOURCE%/*} a POSIX feature?
kustermann
2013/06/12 13:37:07
I don't know. But sdk/bin/dart2js uses BASH_SOURCE
|
+ |
+if [ -z "$DART_CONFIGURATION" ]; |
+then |
ahe
2013/06/12 13:21:19
Keep then on same line as if.
kustermann
2013/06/12 13:37:07
Done.
|
+ DART_CONFIGURATION="ReleaseIA32" |
+fi |
+ |
+DART_ROOT="$(cd "${CUR_DIR}/../.." ; pwd -P)" |
+SDK_DIR="$(cd "${DART_ROOT}/sdk" ; pwd -P)" |
+PKG_ANALYZER="$DART_ROOT/pkg/analyzer_experimental/bin/analyzer.dart" |
+ |
+if [[ `uname` == 'Darwin' ]]; |
+then |
ahe
2013/06/12 13:21:19
Ditto.
kustermann
2013/06/12 13:37:07
Done.
|
+ BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION" |
+else |
+ BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION" |
+fi |
+ |
+PACKAGE_ROOT="$BUILD_DIR/packages/" |
+ |
+FOUND_SDK=0 |
+for ARG in "$@" |
+do |
+ case $ARG in |
+ --dart-sdk) |
+ FOUND_SDK=1 |
+ ;; |
+ *) |
+ ;; |
+ esac |
+done |
+ |
+if [ $FOUND_SDK = 0 ] ; then |
+ exec "$BUILD_DIR/dart" "--package-root=$PACKAGE_ROOT" "${PKG_ANALYZER}" --dart-sdk "${SDK_DIR}" "$@" |
ahe
2013/06/12 13:21:19
Long line.
kustermann
2013/06/12 13:37:07
Done.
|
+else |
+ exec "$BUILD_DIR/dart" "--package-root=$PACKAGE_ROOT" "${PKG_ANALYZER}" "$@" |
+fi |