This repository has been archived by the owner on May 1, 2024. It is now read-only.
forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xabuild
executable file
·56 lines (45 loc) · 1.69 KB
/
xabuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash -e
name=$(basename "$0")
if [ -z "$CONFIGURATION" ] ; then
CONFIGURATION=Debug
fi
xabuilddir="$(cd `dirname "$0"` && pwd)"
if [[ "$xabuilddir" == */tools/scripts ]] ; then
topdir="$xabuilddir/../../bin/$CONFIGURATION"
Paths_targets="$xabuilddir/../../build-tools/scripts/Paths.targets"
elif [[ "$xabuilddir" == */bin ]] ; then
topdir="$xabuilddir/.."
else
(>&2 echo "$name: Could not determine location to Xamarin.Android locations.")
exit 1
fi
if [ -z "$MSBUILD" ] ; then
MSBUILD=xbuild
fi
if [ -z "$ANDROID_NDK_PATH" -a -f "$Paths_targets" ] ; then
ANDROID_NDK_PATH=$($MSBUILD /nologo /v:minimal /t:GetAndroidNdkFullPath "$Paths_targets")
ANDROID_NDK_PATH=$(echo $ANDROID_NDK_PATH | sed 's/^\w*//g')
export ANDROID_NDK_PATH
fi
if [ -z "$ANDROID_SDK_PATH" -a -f "$Paths_targets" ] ; then
ANDROID_SDK_PATH=$($MSBUILD /nologo /v:minimal /t:GetAndroidSdkFullPath "$Paths_targets")
ANDROID_SDK_PATH=$(echo $ANDROID_SDK_PATH | sed 's/^\w*//g')
export ANDROID_SDK_PATH
fi
if [ -z "$ANDROID_NDK_PATH" ] ; then
>&2 echo "$name: Could not determine Android NDK path. Please export the \$ANDROID_NDK_PATH environment variable."
exit 1
fi
if [ -z "$ANDROID_SDK_PATH" ] ; then
>&2 echo "$name: Could not determine Android SDK path. Please export the \$ANDROID_SDK_PATH environment variable."
exit 1
fi
export TARGETS_DIR="$topdir/lib/xbuild"
export MSBuildExtensionsPath="$TARGETS_DIR"
export MONO_ANDROID_PATH="$topdir"
export XBUILD_FRAMEWORK_FOLDERS_PATH="$topdir/lib/xbuild-frameworks"
exec $MSBUILD /p:Configuration=$CONFIGURATION $MSBUILD_OPTIONS \
/p:AndroidNdkDirectory="$ANDROID_NDK_PATH" \
/p:AndroidSdkDirectory="$ANDROID_SDK_PATH" \
/p:MonoDroidInstallDirectory="$MONO_ANDROID_PATH" \
"$@"