diff --git a/MvvmCross.sln b/MvvmCross.sln index 5b767cb3c..67a499cd4 100644 --- a/MvvmCross.sln +++ b/MvvmCross.sln @@ -142,7 +142,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground.Uwp", "Projects\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground.Wpf", "Projects\Playground\Playground.Wpf\Playground.Wpf.csproj", "{88FD9F4C-2A82-4919-91F4-AFB2999F6394}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmCross.Plugins.Visibility.UnitTest", "UnitTests\Plugins.Visibility\MvvmCross.Plugins.Visibility.UnitTest.csproj", "{B5581657-2A45-4FE7-AFC9-96EA06188582}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmCross.Plugins.Visibility.UnitTest", "UnitTests\Plugins.Visibility.UnitTest\MvvmCross.Plugins.Visibility.UnitTest.csproj", "{B5581657-2A45-4FE7-AFC9-96EA06188582}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/UnitTests/Plugins.Visibility/MvvmCross.Plugins.Visibility.UnitTest.csproj b/UnitTests/Plugins.Visibility.UnitTest/MvvmCross.Plugins.Visibility.UnitTest.csproj similarity index 100% rename from UnitTests/Plugins.Visibility/MvvmCross.Plugins.Visibility.UnitTest.csproj rename to UnitTests/Plugins.Visibility.UnitTest/MvvmCross.Plugins.Visibility.UnitTest.csproj diff --git a/UnitTests/Plugins.Visibility/VisibilityCollection.cs b/UnitTests/Plugins.Visibility.UnitTest/VisibilityCollection.cs similarity index 100% rename from UnitTests/Plugins.Visibility/VisibilityCollection.cs rename to UnitTests/Plugins.Visibility.UnitTest/VisibilityCollection.cs diff --git a/UnitTests/Plugins.Visibility/VisibilityValueConverterTest.cs b/UnitTests/Plugins.Visibility.UnitTest/VisibilityValueConverterTest.cs similarity index 100% rename from UnitTests/Plugins.Visibility/VisibilityValueConverterTest.cs rename to UnitTests/Plugins.Visibility.UnitTest/VisibilityValueConverterTest.cs diff --git a/build.cake b/build.cake index 7d5b33593..fe3986095 100644 --- a/build.cake +++ b/build.cake @@ -62,7 +62,13 @@ Task("ResolveBuildTools") .WithCriteria(() => IsRunningOnWindows()) .Does(() => { - var vsLatest = VSWhereLatest(); + var vsWhereSettings = new VSWhereLatestSettings + { + IncludePrerelease = true, + Requires = "Component.Xamarin" + }; + + var vsLatest = VSWhereLatest(vsWhereSettings); msBuildPath = (vsLatest == null) ? null : vsLatest.CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe"); @@ -100,15 +106,76 @@ Task("Build") .WithProperty("Version", versionInfo.SemVer) .WithProperty("PackageVersion", versionInfo.SemVer) .WithProperty("InformationalVersion", versionInfo.InformationalVersion) - .WithProperty("NoPackageAnalysis", "True"); + .WithProperty("NoPackageAnalysis", "True") + .WithTarget("Build"); settings.BinaryLogger = new MSBuildBinaryLogSettings { Enabled = true, - FileName = "mvvmcross.binlog" + //FileName = "mvvmcross.binlog" }; - MSBuild(sln, settings); + // TODO change back to this when parallel builds are working with Xamarin.Android again + // MSBuild(sln, settings); + + var buildItems = new string[] + { + "./MvvmCross/MvvmCross.csproj", + "./MvvmCross.Android.Support/Fragment/MvvmCross.Droid.Support.Fragment.csproj", + "./MvvmCross.Android.Support/Design/MvvmCross.Droid.Support.Design.csproj", + "./MvvmCross.Android.Support/Core.Utils/MvvmCross.Droid.Support.Core.Utils.csproj", + "./MvvmCross.Android.Support/Core.UI/MvvmCross.Droid.Support.Core.UI.csproj", + "./MvvmCross.Android.Support/V7.AppCompat/MvvmCross.Droid.Support.V7.AppCompat.csproj", + "./MvvmCross.Android.Support/V7.Preference/MvvmCross.Droid.Support.V7.Preference.csproj", + "./MvvmCross.Android.Support/V7.RecyclerView/MvvmCross.Droid.Support.V7.RecyclerView.csproj", + "./MvvmCross.Android.Support/V14.Preference/MvvmCross.Droid.Support.V14.Preference.csproj", + "./MvvmCross.Android.Support/V17.Leanback/MvvmCross.Droid.Support.V17.Leanback.csproj", + "./MvvmCross.Plugins/Location/MvvmCross.Plugin.Location.csproj", + "./MvvmCross.Plugins/Location.Fused/MvvmCross.Plugin.Location.Fused.csproj", + "./MvvmCross.Plugins/PictureChooser/MvvmCross.Plugin.PictureChooser.csproj", + "./MvvmCross.Plugins/Email/MvvmCross.Plugin.Email.csproj", + "./MvvmCross.Plugins/Accelerometer/MvvmCross.Plugin.Accelerometer.csproj", + "./MvvmCross.Plugins/Color/MvvmCross.Plugin.Color.csproj", + "./MvvmCross.Plugins/FieldBinding/MvvmCross.Plugin.FieldBinding.csproj", + "./MvvmCross.Plugins/File/MvvmCross.Plugin.File.csproj", + "./MvvmCross.Plugins/Json/MvvmCross.Plugin.Json.csproj", + "./MvvmCross.Plugins/JsonLocalization/MvvmCross.Plugin.JsonLocalization.csproj", + "./MvvmCross.Plugins/Messenger/MvvmCross.Plugin.Messenger.csproj", + "./MvvmCross.Plugins/MethodBinding/MvvmCross.Plugin.MethodBinding.csproj", + "./MvvmCross.Plugins/Network/MvvmCross.Plugin.Network.csproj", + "./MvvmCross.Plugins/PhoneCall/MvvmCross.Plugin.PhoneCall.csproj", + "./MvvmCross.Plugins/PictureChooser/MvvmCross.Plugin.PictureChooser.csproj", + "./MvvmCross.Plugins/ResourceLoader/MvvmCross.Plugin.ResourceLoader.csproj", + "./MvvmCross.Plugins/ResxLocalization/MvvmCross.Plugin.ResxLocalization.csproj", + "./MvvmCross.Plugins/Share/MvvmCross.Plugin.Share.csproj", + "./MvvmCross.Plugins/Sidebar/MvvmCross.Plugin.Sidebar.csproj", + "./MvvmCross.Plugins/Visibility/MvvmCross.Plugin.Visibility.csproj", + "./MvvmCross.Plugins/WebBrowser/MvvmCross.Plugin.WebBrowser.csproj", + "./MvvmCross.Plugins/All/MvvmCross.Plugin.All.csproj", + "./MvvmCross.Forms/MvvmCross.Forms.csproj", + "./MvvmCross.Analyzers/CodeAnalysis/MvvmCross.CodeAnalysis.csproj" + }; + + // workaround for Xamarin.Android throwing AAPT error -2, instead of building sln :( + foreach(var buildItem in buildItems) + { + var filePath = new FilePath(buildItem); + var name = filePath.GetFilenameWithoutExtension(); + + settings.BinaryLogger.FileName = name + ".binlog"; + + MSBuild(filePath, settings); + } + + var testItems = GetFiles("./UnitTests/*.UnitTest/*.UnitTest.csproj"); + foreach(var testItem in testItems) + { + var name = testItem.GetFilenameWithoutExtension(); + + settings.BinaryLogger.FileName = name + ".binlog"; + + MSBuild(testItem, settings); + } }); Task("UnitTest")