From 26b9a96be288145588c3fe2fbeb0e5b6078defc2 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 28 Oct 2015 21:26:55 +0200 Subject: [PATCH 1/2] Added support for building everything on Windows --- build.cake | 19 +++++++++++++++++++ build.ps1 | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/build.cake b/build.cake index 573f479..5a2e995 100644 --- a/build.cake +++ b/build.cake @@ -1,6 +1,7 @@ #addin "Cake.Xamarin" var TARGET = Argument ("t", Argument ("target", Argument ("Target", "Default"))); +var PLATFORMPROJECTS = Argument ("platformprojects", Argument ("PlatformProjects", "Platform")); Task ("libs").Does (() => { @@ -17,6 +18,24 @@ Task ("libs").Does (() => MSBuild ("./WindowsRT/Xamarin.Mobile/Xamarin.Mobile.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86)); CopyFiles ("./WindowsRT/Xamarin.Mobile/bin/**/Release/*.dll", "./output/winrt"); + + if (PLATFORMPROJECTS == "Everything") { + + CreateDirectory ("./output/android/"); + CreateDirectory ("./output/ios-unified/"); + CreateDirectory ("./output/ios/"); + + NuGetRestore ("./Xamarin.Mobile.Mac.sln"); + + MSBuild ("./MonoDroid/Xamarin.Mobile/Xamarin.Mobile.Android.csproj", c => c.SetConfiguration("Release")); + CopyFiles ("./MonoDroid/Xamarin.Mobile/bin/Release/*.dll", "./output/android"); + + MSBuild ("./MonoTouch/Xamarin.Mobile/Xamarin.Mobile.iOS.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + CopyFiles ("./MonoTouch/Xamarin.Mobile/bin/unified/iPhone/Release/*.dll", "./output/ios-unified"); + + MSBuild ("./MonoTouch/Xamarin.Mobile/Xamarin.Mobile.iOS-Classic.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + CopyFiles ("./MonoTouch/Xamarin.Mobile/bin/classic/iPhone/Release/*.dll", "./output/ios"); + } } else { diff --git a/build.ps1 b/build.ps1 index ae70454..711a808 100644 --- a/build.ps1 +++ b/build.ps1 @@ -6,7 +6,9 @@ Param( [string]$Verbosity = "Verbose", [switch]$Experimental, [Alias("DryRun","Noop")] - [switch]$WhatIf + [switch]$WhatIf, + [ValidateSet("Platform", "Everything")] + [string]$PlatformProjects = "Platform" ) $TOOLS_DIR = Join-Path $PSScriptRoot "tools" @@ -70,5 +72,5 @@ if (!(Test-Path $CAKE_EXE)) { } # Start Cake -Invoke-Expression "$CAKE_EXE `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseDryRun $UseExperimental" +Invoke-Expression "$CAKE_EXE `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" -platformprojects=`"$PlatformProjects`" $UseDryRun $UseExperimental" exit $LASTEXITCODE From 3cad398823f3478d39c339ed5be9963a61f73cf9 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 28 Oct 2015 21:35:52 +0200 Subject: [PATCH 2/2] Add the Xamarin samples to the Windows cake build --- build.cake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.cake b/build.cake index 5a2e995..2c23191 100644 --- a/build.cake +++ b/build.cake @@ -67,6 +67,21 @@ Task ("samples").IsDependentOn ("libs").Does (() => MSBuild ("./WindowsRT/Samples/GeolocationSample/GeolocationSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86)); MSBuild ("./WindowsRT/Samples/MediaPickerSample/MediaPickerSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86)); + + if (PLATFORMPROJECTS == "Everything") { + + MSBuild ("./MonoDroid/Samples/ContactsSample/Contacts Sample.csproj", c => c.SetConfiguration("Release")); + MSBuild ("./MonoDroid/Samples/GeolocationSample/Geolocation Sample.csproj", c => c.SetConfiguration("Release")); + MSBuild ("./MonoDroid/Samples/MediaPickerSample/MediaPicker Sample.csproj", c => c.SetConfiguration("Release")); + + MSBuild ("./MonoTouch/Samples/ContactsSample/Contacts Sample.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + MSBuild ("./MonoTouch/Samples/Geolocation/Geolocation Sample.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + MSBuild ("./MonoTouch/Samples/MediaPickerSample/MediaPicker Sample.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + + MSBuild ("./MonoTouch/Samples/ContactsSample-Classic/Contacts Sample-Classic.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + MSBuild ("./MonoTouch/Samples/Geolocation-Classic/Geolocation Sample-Classic.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + MSBuild ("./MonoTouch/Samples/MediaPickerSample-Classic/MediaPicker Sample-Classic.csproj", c => c.SetConfiguration("Release").WithProperty("Platform", "iPhone")); + } } else { DotNetBuild ("./MonoDroid/Samples/ContactsSample/Contacts Sample.csproj", c => c.Configuration = "Release"); DotNetBuild ("./MonoDroid/Samples/GeolocationSample/Geolocation Sample.csproj", c => c.Configuration = "Release");