From eb765390aefe9e9395b61cc26478cf3f5552b48c Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Wed, 20 Apr 2016 18:44:41 +0900 Subject: [PATCH] Add Linux sdk items and fix toolchain downloader to really respect HostOS. - fix Android SDK Tools location. - add SDK/NDK items for Linux. - xbuild condition did not work and downloaded all the items. It was because condition by metadata didn't work with the complicated expression. So, split filtering and transformation into different tasks. - xbuild aborts when the specified metadata %(HostOS) does not exist, so specify dummy HostOS metadata (which is ugly but not too annoying). (Linux build verification is still ongoing, not assuring that this fixes all the possible existing issues.) --- Makefile | 2 +- .../android-toolchain.projitems | 18 ++++++++++- .../android-toolchain.targets | 31 +++++++++++++------ .../DownloadUri.cs | 1 + 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ad8357e788f..73d3eb1a882 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CONFIGURATION = Debug -MSBUILD = xbuild /p:Configuration=$(CONFIGURATION) +MSBUILD = xbuild /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) all: $(MSBUILD) diff --git a/build-tools/android-toolchain/android-toolchain.projitems b/build-tools/android-toolchain/android-toolchain.projitems index a1f54167d02..d6d91888c91 100644 --- a/build-tools/android-toolchain/android-toolchain.projitems +++ b/build-tools/android-toolchain/android-toolchain.projitems @@ -4,6 +4,20 @@ https://dl-ssl.google.com/android/repository + + Linux + + + Linux + build-tools\23.0.0 + + + Linux + platform-tools + + + Linux + Darwin @@ -15,13 +29,15 @@ Darwin platform-tools - + Darwin + platforms\android-N + platforms\android-23 diff --git a/build-tools/android-toolchain/android-toolchain.targets b/build-tools/android-toolchain/android-toolchain.targets index 5bec5a907ec..bcaa07b411a 100644 --- a/build-tools/android-toolchain/android-toolchain.targets +++ b/build-tools/android-toolchain/android-toolchain.targets @@ -11,24 +11,37 @@ + + + + + + + + + DependsOnTargets="_DetermineItems" + Outputs="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)');@(_PlatformAndroidNdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)')"> - + Include="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)"> + + Include="@(_PlatformAndroidNdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)" + Condition=" '%(HostOS)' == '$(HostOS)' Or '%(HostOS)' == '' "> diff --git a/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/DownloadUri.cs b/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/DownloadUri.cs index a5feff48103..d9c4b390773 100644 --- a/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/DownloadUri.cs +++ b/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/DownloadUri.cs @@ -57,6 +57,7 @@ async TTask DownloadFile (HttpClient client, string uri, string destinationFile) Log.LogMessage (MessageImportance.Normal, $"Skipping uri '{uri}' as destination file already exists '{destinationFile}'."); return; } + Log.LogMessage (MessageImportance.Low, $"Downloading '{uri}'."); using (var r = await client.GetAsync (uri)) using (var o = File.OpenWrite (destinationFile)) { await r.Content.CopyToAsync (o);