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

Unified Diff: sdk/bin/dartanalyzer

Issue 628363002: Modify dartanalyzer scripts to look more like dart2js scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address code review comments and rebase Created 6 years, 2 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: sdk/bin/dartanalyzer
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index cc49a5c8293165d323178d90213af08683af46d2..9bd54a6413feaff5d4144517b91e23d5c71e7acb 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -3,7 +3,7 @@
# 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.
-# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart SDK's
+# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart repo's
# directory structure.
function follow_links() {
@@ -24,8 +24,38 @@ SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
SDK_ARG="--dart-sdk=$SDK_DIR"
-SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
-exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"
+
+unset EXTRA_VM_OPTIONS
+declare -a EXTRA_VM_OPTIONS
+
+case $0 in
+ *_developer)
+ EXTRA_VM_OPTIONS+=('--checked')
+ ;;
+esac
+
+# We allow extra vm options to be passed in through an environment variable.
+if [[ $DART_VM_OPTIONS ]]; then
+ read -a OPTIONS <<< "$DART_VM_OPTIONS"
+ EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
+fi
+
+DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
+
+ANALYZER="$DART_ROOT/pkg/analyzer/bin/analyzer.dart"
+
+if [ -z "$DART_CONFIGURATION" ];
+then
+ DART_CONFIGURATION="ReleaseIA32"
+fi
+
+if [[ `uname` == 'Darwin' ]]; then
+ BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
+else
+ BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
+fi
+
+PACKAGE_ROOT="$BUILD_DIR/packages/"
+
+exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$ANALYZER" "$SDK_ARG" "$@"
« no previous file with comments | « editor/tools/analyzer ('k') | sdk/bin/dartanalyzer.bat » ('j') | sdk/bin/dartanalyzer.bat » ('J')

Powered by Google App Engine
This is Rietveld 408576698