Skip to content

Commit 9290b0a

Browse files
committed
Cancel build script if no ANDROID_API is set
1 parent 1265a9a commit 9290b0a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

defaults.sh

+26
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,29 @@ DOTNET_VERSION=${DOTNET_VERSION:-"9.0"}
2424
JAVA_VERSION=${JAVA_VERSION:-"17"}
2525
ANDROID_API=${ANDROID_API:-"$(dotnet workload list | sed -En 's|^android\s+([0-9]+).+$|\1|p')"}
2626
BUILD_TOOLS_VERSION=${BUILD_TOOLS_VERSION:-$(sdkmanager --list 2>/dev/null | grep -E "build-tools;(${ANDROID_API}\.[0-9]+\.[0-9]+)\s+.+$" | tail -1 | sed -En 's|^.+build-tools;(\S+).+$|\1|p')}
27+
28+
if [[ -z "${MAUI_VERSION}" ]]
29+
then
30+
cat <<EOF
31+
WARNING: Could not calculate MAUI version to use.
32+
Set the MAUI_VERSION variable in the environment,
33+
or install the latest dotnet workload android,
34+
with your dotnet workload config in manifest mode.
35+
36+
# dotnet workload config --update-mode manifests
37+
# dotnet workload install maui-android
38+
EOF
39+
fi
40+
41+
if [[ -z "${ANDROID_API}" ]]
42+
then
43+
cat <<EOF
44+
WARNING: Could not calculate Android API version to use.
45+
Set the ANDROID_API variable in the environment,
46+
or install the latest dotnet workload android,
47+
with your dotnet workload config in manifest mode.
48+
49+
# dotnet workload config --update-mode manifests
50+
# dotnet workload install android
51+
EOF
52+
fi

0 commit comments

Comments
 (0)