-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xabuild] Add MSBuild wrapper script to build Xamarin.Android projects
(IDEs?! We don't need no stinkin' IDEs! [0, 1]) `tools/scripts/xabuild` is an `xbuild` ("MSBuild") -using script to support building Xamarin.Android projects from the command-line, without modifying or replacing the "system" Xamarin.Android install. Also handy if there are multiple development branches available. `tools/scripts/xabuild` takes the same command-line arguments as xbuild(1) and MSBuild, allowing projects to be built and application packages to be created: ${xamarin-android-checkout-path}/tools/scripts/xabuild /t:SignAndroidPackage adb install bin/Debug/*-Signed.apk Xamarin.Android.Build.Tasks.dll is updated to look for an alternate, *available*, path to `libmonosgen-2.0.so`, and to remove the %(Reference.Private) metadata so that all required assemblies are installed into $(OutputPath). (Previous versions of Xamarin.Android would encode the ABI into the filename, but this encoding should no longer be necessary.) android-toolchain is altered to provide `_GetAndroidNdkDirectory` and `_GetAndroidNdkDirectory` targets, so that the xabuild script can properly determine the path to the $(AndroidToolchainDirectory) location. [0]: In the spirit of: https://www.youtube.com/watch?v=VqomZQMZQCQ [1]: Seriously, we often like to keep the "system" Xamarin.Android untouched and unchanged, so that we can more easily build filed bugs/etc., so the easiest way to build a Xamarin.Android project from a development branch is from an `xbuild` wrapper script and building from the command line [2]. [2]: https://developer.xamarin.com/guides/android/under_the_hood/build_process/#Build_Targets
- Loading branch information
Showing
5 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -e | ||
topdir="$(cd `dirname "$0"`/../.. && pwd)" | ||
|
||
if [ -z "$CONFIGURATION" ] ; then | ||
CONFIGURATION=Debug | ||
fi | ||
|
||
export TARGETS_DIR="$topdir/bin/$CONFIGURATION/lib/xbuild" | ||
export MSBuildExtensionsPath="$TARGETS_DIR" | ||
export MONO_ANDROID_PATH="$topdir/bin/$CONFIGURATION" | ||
export XBUILD_FRAMEWORK_FOLDERS_PATH="$topdir/bin/$CONFIGURATION/lib/xbuild-frameworks" | ||
ANDROID_NDK_PATH=$(cd $topdir/build-tools/android-toolchain && xbuild /nologo /v:minimal /t:_GetAndroidNdkDirectory android-toolchain.targets) | ||
ANDROID_SDK_PATH=$(cd $topdir/build-tools/android-toolchain && xbuild /nologo /v:minimal /t:_GetAndroidSdkDirectory android-toolchain.targets) | ||
|
||
ANDROID_NDK_PATH=$(echo $ANDROID_NDK_PATH | sed 's/^\w*//g') | ||
ANDROID_SDK_PATH=$(echo $ANDROID_SDK_PATH | sed 's/^\w*//g') | ||
|
||
export ANDROID_NDK_PATH | ||
export ANDROID_SDK_PATH | ||
|
||
exec xbuild $MSBUILD_OPTIONS \ | ||
/p:AndroidNdkDirectory="$ANDROID_NDK_PATH" \ | ||
/p:AndroidSdkDirectory="$ANDROID_SDK_PATH" \ | ||
/p:MonoDroidInstallDirectory="$MONO_ANDROID_PATH" \ | ||
"$@" |