From 5f2478fb8cb1a5d82ac4e70700705004c051ac9e Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 18 Oct 2017 13:39:30 -0500 Subject: [PATCH] [build] setup a Prepare target for Xamarin.Android.sln Context: https://stackoverflow.com/questions/17709873/how-can-i-invoke-my-msbuild-target-when-msbuild-exe-starts-and-when-it-ends There is a convention where an MSBuild file named `Before..sln.targets` will get imported prior to a SLN file getting built. This enables us to import `PrepareWindows.targets` and enable `msbuild Xamarin.Android.sln /t:Prepare` to work appropriately. macOS/linux have remained unchanged, since `PrepareWindows.targets` currently only works for Windows. `make prepare` could be ported to MSBuild in the future. --- Before.Xamarin.Android.sln.targets | 4 ++++ README.md | 4 ++-- build-tools/scripts/PrepareWindows.targets | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 Before.Xamarin.Android.sln.targets diff --git a/Before.Xamarin.Android.sln.targets b/Before.Xamarin.Android.sln.targets new file mode 100644 index 00000000000..a1227711520 --- /dev/null +++ b/Before.Xamarin.Android.sln.targets @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index aa69df538d3..493018464d9 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Building Xamarin.Android requires: * [Autotools (`autoconf`, `automake`, etc.)](#autotools) * [The Android SDK and NDK](#ndk) -The `make prepare` build step (or `PrepareWindows.targets` on Windows) will +The `make prepare` build step (or `/t:Prepare` on Windows) will check that all required dependencies are present. If you would like `make prepare` to automatically install required dependencies, set the `$(AutoProvision)` MSBuild property to True @@ -246,7 +246,7 @@ Unit tests are built in a separate target: To build Xamarin.Android, ensure you are using MSBuild version 15+ and run: - msbuild build-tools\scripts\PrepareWindows.targets + msbuild Xamarin.Android.sln /t:Prepare msbuild Xamarin.Android.sln These are roughly the same as how `make prepare` and `make` are used on other platforms. diff --git a/build-tools/scripts/PrepareWindows.targets b/build-tools/scripts/PrepareWindows.targets index cd4bf91f7c1..521852d5704 100644 --- a/build-tools/scripts/PrepareWindows.targets +++ b/build-tools/scripts/PrepareWindows.targets @@ -18,12 +18,12 @@