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

Unified Diff: sdk/bin/dart

Issue 1276333002: sdk/dart now detects an available build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Make error message better Created 5 years, 4 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/dart
diff --git a/sdk/bin/dart b/sdk/bin/dart
index 675963f746cab46906ff24938d59bf6f07a8023a..3de8c25701db70fc2b3fc2c68d2624e80d4f7b2d 100755
--- a/sdk/bin/dart
+++ b/sdk/bin/dart
@@ -18,16 +18,40 @@ PROG_NAME="$(follow_links "$BASH_SOURCE")"
# Handle the case where dart-sdk/bin has been symlinked to.
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-if [ -z "$DART_CONFIGURATION" ];
+if [[ `uname` == 'Darwin' ]];
then
- DART_CONFIGURATION="ReleaseIA32"
+ OUT_DIR="$CUR_DIR"/../../xcodebuild/
+else
+ OUT_DIR="$CUR_DIR"/../../out/
fi
-if [[ `uname` == 'Darwin' ]];
+if [ -z "$DART_CONFIGURATION" ];
then
- BIN_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION
-else
- BIN_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION
+ DIRS=$( ls "$OUT_DIR" )
+ # list of possible configurations in decreasing desirability
+ CONFIGS=("ReleaseIA32" "ReleaseX64" "DebugIA32" "DebugX64"
+ "ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE" "ReleaseMIPS"
+ "DebugARM" "DebugARM64" "DebugARMV5TE" "DebugMIPS")
+ DART_CONFIGURATION="None"
+ for CONFIG in ${CONFIGS[*]}
+ do
+ for DIR in $DIRS;
+ do
+ if [ "$CONFIG" = "$DIR" ];
+ then
+ # choose most desirable configuration that is available and break
+ DART_CONFIGURATION="$DIR"
+ break 2
+ fi
+ done
+ done
+ if [ "$DART_CONFIGURATION" = "None" ]
+ then
+ echo "No valid dart configuration found in $OUT_DIR"
+ exit 1
+ fi
fi
+BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
+
exec "$BIN_DIR"/dart "$@"
« 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