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

Unified Diff: sdk/bin/dartanalyzer

Issue 1314893003: sdk/dartanalyzer now detects an available build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase master 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/dartanalyzer
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index ea697386a7b4ecddfc1acc8fd4743954cde079f0..9b4a2abbc214494175af9ca82e8ba9884e35e90b 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -45,17 +45,42 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
ANALYZER="$DART_ROOT/third_party/pkg/analyzer_cli/bin/analyzer.dart"
-if [ -z "$DART_CONFIGURATION" ];
+if [[ `uname` == 'Darwin' ]];
then
- DART_CONFIGURATION="ReleaseIA32"
+ OUT_DIR="$DART_ROOT/xcodebuild/"
+else
+ OUT_DIR="$DART_ROOT/out/"
fi
-if [[ `uname` == 'Darwin' ]]; then
- BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
-else
- BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
+if [ -z "$DART_CONFIGURATION" ];
+then
+ 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
+BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
+
PACKAGE_ROOT="$BUILD_DIR/packages/"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$ANALYZER" "$SDK_ARG" "$@"
« 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