Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msbuild] Move from xbuild to msbuild #4111

Merged
merged 25 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c7b0514
[msbuild] Replace all invocations of xbuild with msbuild
radical May 9, 2018
256035e
[msbuild] Update xbuild assembly references to msbuild ones
radical May 9, 2018
a5670f2
[msbuild] Port the tasks and tests to use new msbuild API
radical May 17, 2018
18f7168
[tests] Fix DetectAppManifest_ExecutableProject_NoPList
radical May 21, 2018
2805bea
[tests] Ensure that the correct msbuild.dll.config gets picked up
radical May 21, 2018
b883c4f
[tests] Don't use WriteLine in TestHelpers.Loggers as msbuild adds that
radical May 21, 2018
9e53fd5
[tests] Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_TouchLibraryDll
radical May 17, 2018
6fc89ab
[tests] msbuild-mac Fix tests depending on msbuild specific strings
radical May 17, 2018
26abe1b
[tests] Fix tests that depend on tool output
radical May 17, 2018
8f0df14
[tests] Remove project path at the end of errors/warnings before comp…
radical May 18, 2018
6278f10
[tests] Remove `bool useMSBuild` arg from ProjectTestHelpers
radical May 18, 2018
b578593
[tests] Remove TI.UnifiedTestConfig.DiagnosticMSBuild
radical May 22, 2018
526f009
[tests] Fix Xamarin.iOS.Tasks.TargetTests.GenerateBundleName_Executab…
radical May 21, 2018
16e512a
Revert "[msbuild] Add forward compatibility with symlinks support (#6…
radical May 21, 2018
516aab9
Merge remote-tracking branch 'origin/master' into msbuild-port
rolfbjarne Jul 27, 2018
19d9a64
[xharness] Don't add LogicalName beneath Import elements, it doesn't …
rolfbjarne Jul 27, 2018
afcad3b
[xharness] Set the right variable to point msbuild to our locally bui…
rolfbjarne Jul 27, 2018
50e0554
[xharness] Process Import elements, but don't add LogicalName to them.
rolfbjarne Jul 27, 2018
06d7410
Remove debug spew.
rolfbjarne Jul 27, 2018
2e75028
[tests] Set XamarinMacFrameworkRoot as an environment variable when r…
rolfbjarne Jul 30, 2018
acad87b
Bump system mono to 5.16 to see if that gets an MSBuild with the fixe…
rolfbjarne Jul 30, 2018
42645d5
[tests][msbuild] Seems like we need to copy System.Reflection.Metadat…
rolfbjarne Jul 31, 2018
745c18c
Merge remote-tracking branch 'origin/master' into msbuild-port
rolfbjarne Oct 11, 2018
4362842
[mmptests] Update according to MSBuild changes.
rolfbjarne Oct 11, 2018
5fbfacc
[tests] Only restore packages.config, not the mtouch test project.
rolfbjarne Oct 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ SYSTEM_CSC=$(MONO_PREFIX)/bin/csc
SYSTEM_SN=$(MONO_PREFIX)/bin/sn
SYSTEM_MONO=$(MONO_PREFIX)/bin/mono
SYSTEM_MONO32=$(MONO_PREFIX)/bin/mono32
SYSTEM_XBUILD=$(MONO_PREFIX)/bin/xbuild
SYSTEM_XBUILD=$(MONO_PREFIX)/bin/msbuild
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone should do %s/SYSTEM_XBUILD/SYSTEM_MSBUILD/gc at some later point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

um should I do it in this PR itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it as commit after all the changes here, that should keep the review of the patches easy and clean. And this will be just a safe cosmetic fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will open a new PR for that.

SYSTEM_MSBUILD=unset MSBuildExtensionsPath && $(MONO_PREFIX)/bin/msbuild
SYSTEM_RESGEN=$(MONO_PREFIX)/bin/resgen

Expand Down
4 changes: 2 additions & 2 deletions fsharp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ build/%.dll: $(BIN_DIR)/%.dll | build/monotouch build/xamarinmacmobile build/xam
$(Q) cp $< $@
$(Q_SN) MONO_CFG_DIR="$(TOP)" sn -q -R "$@" "$(PRODUCT_KEY_PATH)"

build.stamp: export XBUILD_FRAMEWORK_FOLDERS_PATH=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks
build.stamp: export MSBuildExtensionsPath=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild
build.stamp: export TargetFrameworkFallbackSearchPaths=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks
build.stamp: export MSBuildExtensionsPathFallbackPathsOverride=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild
build.stamp: $(FSHARP_FILES) $(FSHARP_PATH)/Makefile
$(MAKE) -C $(FSHARP_PATH)/src/fsharp build-proto
$(MAKE) -C $(FSHARP_PATH)/src/fsharp $(FSHARP_BUILD_TARGETS)
Expand Down
11 changes: 5 additions & 6 deletions msbuild/Xamarin.Mac.Tasks.Core/Xamarin.Mac.Tasks.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build" HintPath="$(MSBuildBinPath)\Microsoft.Build.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
Expand All @@ -53,4 +52,4 @@
<Name>Xamarin.MacDev.Tasks.Core</Name>
</ProjectReference>
</ItemGroup>
</Project>
</Project>
9 changes: 4 additions & 5 deletions msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build" HintPath="$(MSBuildBinPath)\Microsoft.Build.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="Tasks\ACTool.cs" />
Expand Down
1 change: 0 additions & 1 deletion msbuild/Xamarin.MacDev.Tasks.Core/MsBuildTasks/CopyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
public abstract class CopyBase : Copy
{
public string SessionId { get; set; }
public bool UseSymboliclinksIfPossible { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="Mono.Posix" />
Expand Down
7 changes: 3 additions & 4 deletions msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static bool TryRunMSBuildGetPropertyValueTarget (string path, string propertyNam
arguments = string.Format ("{0} /p:TargetFrameworkIdentifier={1}", arguments, targetFrameworkIdentifier);
}

var psi = new ProcessStartInfo ("/Library/Frameworks/Mono.framework/Commands/xbuild", arguments);
var psi = new ProcessStartInfo ("/Library/Frameworks/Mono.framework/Commands/msbuild", arguments);

psi.UseShellExecute = false;
psi.RedirectStandardError = true;
Expand Down
9 changes: 4 additions & 5 deletions msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Tasks.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build" HintPath="$(MSBuildBinPath)\Microsoft.Build.dll" />
<Reference Include="System" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions msbuild/Xamarin.iOS.Tasks/Xamarin.iOS.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Framework" HintPath="$(MSBuildBinPath)\Microsoft.Build.Framework.dll" />
<Reference Include="Microsoft.Build.Utilities.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll" />
<Reference Include="Microsoft.Build.Tasks.Core" HintPath="$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void BuildTest ()
AppBundlePath = mtouchPaths.AppBundlePath;
var dllPath = Path.Combine(mtouchPaths.ProjectBinPath, "bindings-test.dll");

Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);

RunTarget (proj, "Build", 0);
Assert.IsTrue (File.Exists (dllPath), "{1} binding dll does not exist: {0} ", dllPath, Platform);
Expand All @@ -43,7 +43,7 @@ public void FrameworkTest ()
AppBundlePath = mtouchPaths.AppBundlePath;
var dllPath = Path.Combine(mtouchPaths.ProjectBinPath, "bindings-test.dll");

Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);

RunTarget (proj, "Build", 0);
Assert.IsTrue (File.Exists (dllPath), "{1} binding dll does not exist: {0} ", dllPath, Platform);
Expand Down
11 changes: 6 additions & 5 deletions msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Linq;
using System.Collections;

using NUnit.Framework;
using Microsoft.Build.Evaluation;

using Microsoft.Build.BuildEngine;
using NUnit.Framework;

namespace Xamarin.iOS.Tasks
{
Expand All @@ -30,8 +30,8 @@ public void TestACToolTaskCatchesJsonException ()
var project = SetupProject (Engine, csproj);

AppBundlePath = mtouchPaths ["app_bundlepath"];
Engine.GlobalProperties.SetProperty("Platform", platform);
Engine.GlobalProperties.SetProperty("Configuration", config);
Engine.ProjectCollection.SetGlobalProperty("Platform", platform);
Engine.ProjectCollection.SetGlobalProperty("Configuration", config);

if (clean) {
RunTarget (project, "Clean");
Expand All @@ -56,8 +56,9 @@ public void TestACToolTaskCatchesJsonException ()
}

project = SetupProject (Engine, mtouchPaths.ProjectCSProjPath);
var projectInstance = project.CreateProjectInstance ();

Engine.BuildProject (project, new [] { target }, new Hashtable { {"Platform", "iPhone"} }, BuildSettings.None);
Engine.BuildProject (projectInstance, new [] { target }, new Hashtable { {"Platform", "iPhone"} });
if (Engine.Logger.ErrorEvents.Count != 1) {
string messages = string.Empty;
if (Engine.Logger.ErrorEvents.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void BuildExtension (string hostAppName, string extensionName, string bun

AppBundlePath = mtouchPaths ["app_bundlepath"];
string extensionPath = Path.Combine(AppBundlePath, "PlugIns", extensionName + ".appex");
Engine.GlobalProperties.SetProperty ("Platform", platform);
Engine.GlobalProperties.SetProperty ("Configuration", config);
Engine.ProjectCollection.SetGlobalProperty ("Platform", platform);
Engine.ProjectCollection.SetGlobalProperty ("Configuration", config);

RunTarget (proj, "Clean");
Assert.IsFalse (Directory.Exists (AppBundlePath), "{1}: App bundle exists after cleanup: {0} ", AppBundlePath, bundlePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void InvalidBundleIdTest ()
File.WriteAllText (appInfoPath, appInfoContents.Replace ("<string>com.xamarin.MyWatchApp</string>", "<string>com.xamarin.MyWatchAppX</string>"));

var proj = SetupProject (Engine, mtouchPaths.ProjectCSProjPath);
Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);
AppBundlePath = mtouchPaths ["app_bundlepath"];
RunTarget (proj, "Build", 2);
Assert.AreEqual ("The App Extension 'WatchExtension' has an invalid CFBundleIdentifier (com.xamarin.MyWatchApp.WatchExtension), it does not begin with the main app bundle's CFBundleIdentifier (com.xamarin.MyWatchAppX).", Engine.Logger.ErrorEvents [0].Message, "#1");
Expand All @@ -73,12 +73,12 @@ public void CreateIpa ()

AppBundlePath = mtouchPaths.AppBundlePath;

Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.GlobalProperties.SetProperty ("BuildIpa", "true");
Engine.GlobalProperties.SetProperty ("IpaIncludeArtwork", "true");
Engine.GlobalProperties.SetProperty ("CodesignProvision", "Automatic"); // Provisioning profile
Engine.GlobalProperties.SetProperty ("CodesignKey", "iPhone Developer");
Engine.GlobalProperties.SetProperty ("Configuration", configuration);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("BuildIpa", "true");
Engine.ProjectCollection.SetGlobalProperty ("IpaIncludeArtwork", "true");
Engine.ProjectCollection.SetGlobalProperty ("CodesignProvision", "Automatic"); // Provisioning profile
Engine.ProjectCollection.SetGlobalProperty ("CodesignKey", "iPhone Developer");
Engine.ProjectCollection.SetGlobalProperty ("Configuration", configuration);

RunTarget (proj, "Clean");
Assert.IsFalse (Directory.Exists (AppBundlePath), "{1}: App bundle exists after cleanup: {0} ", AppBundlePath, Platform);
Expand Down Expand Up @@ -115,7 +115,7 @@ public void CreateIpa ()
string wkPath = "WatchKitSupport/WK";
Assert.Contains (wkPath, lines, wkPath + " does not exist");

var ipaIncludeArtwork = proj.GetEvaluatedProperty ("IpaIncludeArtwork");
var ipaIncludeArtwork = proj.GetPropertyValue ("IpaIncludeArtwork");
Assert.IsTrue (output.Contains ("iTunesMetadata.plist"), string.Format ("The ipa should contain at least one iTunesMetadata.plist file if we are using an AppStore config and IpaIncludeArtwork is true. IpaIncludeArtwork: {0}", ipaIncludeArtwork));

RunTarget (proj, "Clean");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;

namespace Xamarin.iOS.Tasks {
Expand All @@ -16,12 +17,12 @@ public void BasicTest ()
{
var mtouchPaths = SetupProjectPaths ("MyTabbedApplication", "../", true, Platform);

Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);

var proj = SetupProject (Engine, mtouchPaths.ProjectCSProjPath);
var nr = proj.AddNewItem ("NativeReference", Path.Combine (".", "..", "..", "..", "tests", "test-libraries", ".libs", "ios", "XTest.framework"));
nr.SetMetadata ("IsCxx", "False");
nr.SetMetadata ("Kind", "Framework");
var nr = proj.AddItem ("NativeReference", Path.Combine (".", "..", "..", "..", "tests", "test-libraries", ".libs", "ios", "XTest.framework")).First ();
nr.SetMetadataValue ("IsCxx", "False");
nr.SetMetadataValue ("Kind", "Framework");

AppBundlePath = mtouchPaths.AppBundlePath;

Expand All @@ -40,14 +41,14 @@ public void WithIncrementalBuilds ()

var mtouchPaths = SetupProjectPaths ("MyiOSAppWithBinding", "../", true, Platform);

Engine.GlobalProperties.SetProperty ("Platform", Platform);
Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform);

var proj = SetupProject (Engine, mtouchPaths.ProjectCSProjPath);

proj.GlobalProperties.SetProperty ("MtouchFastDev", "true");
proj.GlobalProperties.SetProperty ("MtouchExtraArgs", "-vvvv");
proj.GlobalProperties.SetProperty ("MtouchArch", "ARM64"); // only use ARM64 to speed up the build.
proj.GlobalProperties.SetProperty ("MtouchLink", "Full"); // also to speed up the build.
proj.SetGlobalProperty ("MtouchFastDev", "true");
proj.SetGlobalProperty ("MtouchExtraArgs", "-vvvv");
proj.SetGlobalProperty ("MtouchArch", "ARM64"); // only use ARM64 to speed up the build.
proj.SetGlobalProperty ("MtouchLink", "Full"); // also to speed up the build.

AppBundlePath = mtouchPaths.AppBundlePath;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public string BuildProject (string appName, string platform, string config, int
var proj = SetupProject (Engine, csproj);

AppBundlePath = mtouchPaths ["app_bundlepath"];
Engine.GlobalProperties.SetProperty("Platform", platform);
Engine.GlobalProperties.SetProperty("Configuration", config);
Engine.ProjectCollection.SetGlobalProperty("Platform", platform);
Engine.ProjectCollection.SetGlobalProperty("Configuration", config);

if (clean) {
RunTarget (proj, "Clean");
Expand Down
Loading