mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
sdk/dartanalyzer now detects an available build
Similar to CL 1276333002; this allows the dartanalyzer script to pick an available build, rather than failing if ReleaseIA32 is not available. BUG= R=floitsch@google.com Review URL: https://codereview.chromium.org//1314893003 .
This commit is contained in:
parent
271bc1f776
commit
fe402c50ea
|
@ -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" "$@"
|
||||
|
|
Loading…
Reference in a new issue