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

Unified Diff: sdk/bin/dart2analyzer

Issue 16667023: Fixed sdk/bin/dart2analyzer to use package-root (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/bin/dart2analyzer
diff --git a/sdk/bin/dart2analyzer b/sdk/bin/dart2analyzer
index 4c1767198e6431e2663766e7a882c361178168ca..b10731222475886ed6d1782f3cda951dd81d2363 100755
--- a/sdk/bin/dart2analyzer
+++ b/sdk/bin/dart2analyzer
@@ -3,21 +3,34 @@
# 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.
+# NOTE: This file is not supposed to be included in the SDK.
ricow1 2013/06/11 10:35:34 So why don't we move it?
kustermann 2013/06/11 10:38:29 Sure. Where should we move it to?
scheglov 2013/06/11 20:07:53 For now yes, this file should not be included in t
ricow1 2013/06/12 07:54:22 OK - for future reference please only place stuff
scheglov 2013/06/12 08:47:43 OK, agree. Lets move it to the appropriate place
+# It is currently only used by test.dart for testing pkg/analyzer_experimental.
+
set -e
-BIN_DIR="$(cd "${BASH_SOURCE%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-DART="$BIN_DIR/dart"
-PKG_ANALYZER="$BIN_DIR/../packages/analyzer_experimental/bin/analyzer.dart"
+CUR_DIR="$(cd "${BASH_SOURCE%/*}" ; pwd -P)"
+
+if [ -z "$DART_CONFIGURATION" ];
+then
+ DART_CONFIGURATION="ReleaseIA32"
+fi
+
+if [[ `uname` == 'Darwin' ]];
+then
+ BUILD_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION
+else
+ BUILD_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION
+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"
+PACKAGE_ROOT="$DART_ROOT/out/$DART_CONFIGURATION/packages/"
-FOUND_BATCH=0
FOUND_SDK=0
for ARG in "$@"
do
case $ARG in
- -batch|--batch)
- FOUND_BATCH=1
- ;;
--dart-sdk)
FOUND_SDK=1
;;
@@ -27,7 +40,7 @@ do
done
if [ $FOUND_SDK = 0 ] ; then
- exec "$DART" "${PKG_ANALYZER}" --dart-sdk "${SDK_DIR}" "$@"
kustermann 2013/06/11 10:28:15 Which script passes a boolean '--dart-sdk' flag to
scheglov 2013/06/11 20:07:53 In general, this is script which users may call to
ricow1 2013/06/12 07:54:22 What does that flag do?
scheglov 2013/06/12 08:47:43 It allows to analyze against different SDK than SD
+ exec "$BUILD_DIR/dart" "--package-root=$PACKAGE_ROOT" "${PKG_ANALYZER}" --dart-sdk "${SDK_DIR}" "$@"
else
- exec "$DART" "${PKG_ANALYZER}" "$@"
+ exec "$BUILD_DIR/dart" "--package-root=$PACKAGE_ROOT" "${PKG_ANALYZER}" "$@"
kustermann 2013/06/11 10:28:15 I have no idea how worked without '--package-root'
ricow1 2013/06/11 10:35:34 Did it?
kustermann 2013/06/11 10:38:29 It didn't work on my machine. But I expected that
ricow1 2013/06/12 07:54:22 Konstantin: how are you setting the package root w
scheglov 2013/06/12 08:47:43 It seems that it worked only on my machine :-( I
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698