Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 8704b84

Browse files
committed
Use MSBuild 14.0 if available.
1 parent b294821 commit 8704b84

File tree

8 files changed

+195
-1
lines changed

8 files changed

+195
-1
lines changed

SharpDevelop.Tests.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDevelop", "src\Main\Sh
2828
EndProject
2929
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker120", "src\Main\ICSharpCode.SharpDevelop.BuildWorker120\ICSharpCode.SharpDevelop.BuildWorker120.csproj", "{6F273DA5-E10C-45A6-9071-7313ECD98C90}"
3030
EndProject
31+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker140", "src\Main\ICSharpCode.SharpDevelop.BuildWorker140\ICSharpCode.SharpDevelop.BuildWorker140.csproj", "{7BA66A6B-1ED8-4B4C-970C-8928E891418B}"
32+
EndProject
3133
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}"
3234
EndProject
3335
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}"
@@ -290,6 +292,10 @@ Global
290292
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.Build.0 = Debug|Any CPU
291293
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.ActiveCfg = Release|Any CPU
292294
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.Build.0 = Release|Any CPU
295+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
296+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Debug|Any CPU.Build.0 = Debug|Any CPU
297+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.ActiveCfg = Release|Any CPU
298+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.Build.0 = Release|Any CPU
293299
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU
294300
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU
295301
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
@@ -666,6 +672,7 @@ Global
666672
{8035765F-D51F-4A0C-A746-2FD100E19419} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
667673
{1152B71B-3C05-4598-B20D-823B5D40559E} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
668674
{6F273DA5-E10C-45A6-9071-7313ECD98C90} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
675+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
669676
{D68133BD-1E63-496E-9EDE-4FBDBF77B486} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
670677
{6222A3A1-83CE-47A3-A4E4-A018F82D44D8} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
671678
{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}

SharpDevelop.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDevelop", "src\Main\Sh
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker120", "src\Main\ICSharpCode.SharpDevelop.BuildWorker120\ICSharpCode.SharpDevelop.BuildWorker120.csproj", "{6F273DA5-E10C-45A6-9071-7313ECD98C90}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker140", "src\Main\ICSharpCode.SharpDevelop.BuildWorker140\ICSharpCode.SharpDevelop.BuildWorker140.csproj", "{7BA66A6B-1ED8-4B4C-970C-8928E891418B}"
28+
EndProject
2729
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}"
2830
EndProject
2931
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}"
@@ -237,6 +239,10 @@ Global
237239
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.Build.0 = Debug|Any CPU
238240
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.ActiveCfg = Release|Any CPU
239241
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.Build.0 = Release|Any CPU
242+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
243+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Debug|Any CPU.Build.0 = Debug|Any CPU
244+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.ActiveCfg = Release|Any CPU
245+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.Build.0 = Release|Any CPU
240246
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU
241247
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU
242248
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
@@ -527,6 +533,7 @@ Global
527533
{8035765F-D51F-4A0C-A746-2FD100E19419} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
528534
{1152B71B-3C05-4598-B20D-823B5D40559E} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
529535
{6F273DA5-E10C-45A6-9071-7313ECD98C90} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
536+
{7BA66A6B-1ED8-4B4C-970C-8928E891418B} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
530537
{D68133BD-1E63-496E-9EDE-4FBDBF77B486} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
531538
{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
532539
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371} = {E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865}

src/Main/Base/Project/Util/DotnetDetection.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,16 @@ public static bool IsBuildTools2013Installed()
9595
return key != null && key.GetValue("Install") as int? >= 1;
9696
}
9797
}
98+
99+
/// <summary>
100+
/// Gets whether the Microsoft Build Tools 2015 (MSBuild 14.0) is installed.
101+
/// </summary>
102+
public static bool IsBuildTools2015Installed()
103+
{
104+
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\BuildTools\Servicing\14.0
105+
using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\DevDiv\BuildTools\Servicing\14.0\MSBuild")) {
106+
return key != null && key.GetValue("Install") as int? >= 1;
107+
}
108+
}
98109
}
99110
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
// software and associated documentation files (the "Software"), to deal in the Software
5+
// without restriction, including without limitation the rights to use, copy, modify, merge,
6+
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
// to whom the Software is furnished to do so, subject to the following conditions:
8+
//
9+
// The above copyright notice and this permission notice shall be included in all copies or
10+
// substantial portions of the Software.
11+
//
12+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14+
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15+
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
// DEALINGS IN THE SOFTWARE.
18+
19+
using System;
20+
using System.Reflection;
21+
22+
[assembly: AssemblyTitle("SharpDevelop Build Worker for MSBuild 14.0")]
23+
[assembly: AssemblyDescription("Runs MSBuild 14.0")]
24+
[assembly: AssemblyConfiguration("")]
25+
[assembly: AssemblyTrademark("")]
26+
[assembly: AssemblyCulture("")]
27+
[assembly: CLSCompliant(true)]
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
3+
<PropertyGroup>
4+
<ProjectGuid>{7BA66A6B-1ED8-4B4C-970C-8928E891418B}</ProjectGuid>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<OutputType>Exe</OutputType>
8+
<RootNamespace>ICSharpCode.SharpDevelop.BuildWorker</RootNamespace>
9+
<AssemblyName>ICSharpCode.SharpDevelop.BuildWorker140</AssemblyName>
10+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
11+
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
12+
<NoStdLib>False</NoStdLib>
13+
<WarningLevel>4</WarningLevel>
14+
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
15+
<OutputPath>..\..\..\bin\</OutputPath>
16+
<SignAssembly>True</SignAssembly>
17+
<AssemblyOriginatorKeyFile>..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
18+
<DelaySign>False</DelaySign>
19+
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
20+
<RunCodeAnalysis>False</RunCodeAnalysis>
21+
<CodeAnalysisRules>-Microsoft.Globalization#CA1303</CodeAnalysisRules>
22+
<TargetFrameworkProfile>
23+
</TargetFrameworkProfile>
24+
<NoWin32Manifest>False</NoWin32Manifest>
25+
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
28+
<DebugSymbols>true</DebugSymbols>
29+
<DebugType>Full</DebugType>
30+
<Optimize>False</Optimize>
31+
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
32+
<DefineConstants>DEBUG;TRACE</DefineConstants>
33+
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
36+
<DebugSymbols>False</DebugSymbols>
37+
<DebugType>None</DebugType>
38+
<Optimize>True</Optimize>
39+
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
40+
<DefineConstants>TRACE</DefineConstants>
41+
</PropertyGroup>
42+
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
43+
<RegisterForComInterop>False</RegisterForComInterop>
44+
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
45+
<BaseAddress>4194304</BaseAddress>
46+
<PlatformTarget>AnyCPU</PlatformTarget>
47+
<FileAlignment>4096</FileAlignment>
48+
<Prefer32Bit>True</Prefer32Bit>
49+
</PropertyGroup>
50+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
51+
<ItemGroup>
52+
<Reference Include="Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
53+
<Reference Include="Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
54+
<Reference Include="System" />
55+
<Reference Include="System.Core" />
56+
<Reference Include="System.Windows.Forms" />
57+
<Reference Include="System.Xml" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Compile Include="..\GlobalAssemblyInfo.cs">
61+
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
62+
</Compile>
63+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\BuildJob.cs">
64+
<Link>BuildJob.cs</Link>
65+
</Compile>
66+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\EventSource.cs">
67+
<Link>EventSource.cs</Link>
68+
</Compile>
69+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\EventTypes.cs">
70+
<Link>EventTypes.cs</Link>
71+
</Compile>
72+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\ExtendedBinaryReader.cs">
73+
<Link>ExtendedBinaryReader.cs</Link>
74+
</Compile>
75+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\HostProcess.cs">
76+
<Link>HostProcess.cs</Link>
77+
</Compile>
78+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\MSBuild40.cs">
79+
<Link>MSBuild40.cs</Link>
80+
</Compile>
81+
<Compile Include="..\ICSharpCode.SharpDevelop.BuildWorker\Program.cs">
82+
<Link>Program.cs</Link>
83+
</Compile>
84+
<Compile Include="Configuration\AssemblyInfo.cs" />
85+
</ItemGroup>
86+
<ItemGroup>
87+
<ProjectReference Include="..\Core\Project\ICSharpCode.Core.csproj">
88+
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
89+
<Name>ICSharpCode.Core</Name>
90+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
91+
</ProjectReference>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<Folder Include="Configuration" />
95+
</ItemGroup>
96+
<ItemGroup>
97+
<None Include="app.config" />
98+
</ItemGroup>
99+
</Project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<configSections>
4+
<!-- Microsoft.Build.Engine instead of Microsoft.Build here because a task run under Microsoft.Build may load Microsoft.Build.Engine, which will attempt to read this section. -->
5+
<section name="msbuildToolsets" type="Microsoft.Build.BuildEngine.ToolsetConfigurationSection, Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
6+
</configSections>
7+
<startup useLegacyV2RuntimeActivationPolicy="true">
8+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
9+
</startup>
10+
<runtime>
11+
<DisableFXClosureWalk enabled="true" />
12+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
13+
<!-- redirect MSBuild.Framework requests to make old task assemblies work with MSBuild 12.0 -->
14+
<dependentAssembly>
15+
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
16+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/>
17+
</dependentAssembly>
18+
<dependentAssembly>
19+
<assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
20+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/>
21+
</dependentAssembly>
22+
<dependentAssembly>
23+
<assemblyIdentity name="Microsoft.Build" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
24+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/>
25+
</dependentAssembly>
26+
<dependentAssembly>
27+
<assemblyIdentity name="Microsoft.Build.Conversion.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
28+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/>
29+
</dependentAssembly>
30+
<dependentAssembly>
31+
<assemblyIdentity name="Microsoft.Build.Tasks.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
32+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/>
33+
</dependentAssembly>
34+
<dependentAssembly>
35+
<assemblyIdentity name="Microsoft.CompactFramework.Build.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
36+
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="9.0.0.0"/>
37+
</dependentAssembly>
38+
</assemblyBinding>
39+
</runtime>
40+
</configuration>

src/Main/SharpDevelop/Project/Build/MSBuildEngine/BuildWorkerManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ sealed class BuildWorkerManager
3434
readonly List<BuildWorker> freeWorkers = new List<BuildWorker>();
3535
readonly string workerProcessName;
3636

37+
public static readonly BuildWorkerManager MSBuild140 = new BuildWorkerManager("ICSharpCode.SharpDevelop.BuildWorker140.exe");
3738
public static readonly BuildWorkerManager MSBuild120 = new BuildWorkerManager("ICSharpCode.SharpDevelop.BuildWorker120.exe");
3839
public static readonly BuildWorkerManager MSBuild40 = new BuildWorkerManager("ICSharpCode.SharpDevelop.BuildWorker40.exe");
3940
public static readonly BuildWorkerManager MSBuild35 = new BuildWorkerManager("ICSharpCode.SharpDevelop.BuildWorker35.exe");

src/Main/SharpDevelop/Project/Build/MSBuildEngine/MSBuildEngineWorker.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ internal Task<bool> RunBuildAsync(CancellationToken cancellationToken)
160160
tcs.SetResult(false);
161161
}
162162
} else {
163-
if (DotnetDetection.IsBuildTools2013Installed()) {
163+
if (DotnetDetection.IsBuildTools2015Installed()) {
164+
BuildWorkerManager.MSBuild140.RunBuildJob(job, loggerChain, OnDone, cancellationToken);
165+
} else if (DotnetDetection.IsBuildTools2013Installed()) {
164166
BuildWorkerManager.MSBuild120.RunBuildJob(job, loggerChain, OnDone, cancellationToken);
165167
} else {
166168
BuildWorkerManager.MSBuild40.RunBuildJob(job, loggerChain, OnDone, cancellationToken);

0 commit comments

Comments
 (0)