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

Get rid of MSBuildTaskHelper and always use RoslynCodeTaskFactory #2581

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions build/Common.Build.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$(MSBuildThisFileDirectory)MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'"/>
<UsingTask TaskName="_GetCommonFiles" TaskFactory="$(MSBuildTaskFactoryType)" AssemblyFile="$(MSBuildTasksAssemblyFile)">
<UsingTask TaskName="_GetCommonFiles" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Names ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
Expand Down Expand Up @@ -135,7 +134,7 @@

<UsingTask
TaskName="GetMetadata"
TaskFactory="$(MSBuildTaskFactoryType)" AssemblyFile="$(MSBuildTasksAssemblyFile)">
TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<ItemGroup ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Output Output="true" />
Expand Down
1 change: 0 additions & 1 deletion build/Common.Mac.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<!-- Include this file if you want to reference Eto.Mac64.csproj directly vs. using the nuget package -->

<Import Project="$(MSBuildThisFileDirectory)MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'"/>
<Import Project="$(MSBuildThisFileDirectory)..\src\Eto.Mac\build\Mac.props" />
<Import Project="$(MSBuildThisFileDirectory)..\src\Eto.Mac\build\Mac.targets" />

Expand Down
39 changes: 0 additions & 39 deletions build/MSBuildTaskHelper.props

This file was deleted.

5 changes: 2 additions & 3 deletions build/Utilities.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'"/>

<UsingTask TaskName="FileUpdate" TaskFactory="$(MSBuildTaskFactoryType)" AssemblyFile="$(MSBuildTasksAssemblyFile)">
<UsingTask TaskName="FileUpdate" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Pattern ParameterType="System.String" Required="true" />
Expand Down Expand Up @@ -111,7 +110,7 @@ public class FileUpdate : Task
]]> </Code>
</Task>
</UsingTask>
<UsingTask TaskName="IncrementVersion" TaskFactory="$(MSBuildTaskFactoryType)" AssemblyFile="$(MSBuildTasksAssemblyFile)">
<UsingTask TaskName="IncrementVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Version ParameterType="System.String" Required="true" />
<Increment ParameterType="System.String" />
Expand Down
2 changes: 0 additions & 2 deletions src/Eto.Mac/Eto.Mac64.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ You do not need to use any of the classes of this assembly (unless customizing t
<None Include="build\*" Exclude="build\Mac.*" Pack="True" PackagePath="build" />
<None Include="build\Mac.targets" Pack="True" PackagePath="build\$(PackageId).targets" />
<None Include="build\Mac.props" Pack="True" PackagePath="build\$(PackageId).props" />

<None Include="..\..\build\MSBuildTaskHelper.props" Pack="True" PackagePath="build" />
</ItemGroup>

<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
Expand Down
1 change: 0 additions & 1 deletion src/Eto.Mac/Eto.XamMac2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ You do not need to use any of the classes of this assembly (unless customizing t
<None Include="build\*" Exclude="build\Mac.*" Pack="True" PackagePath="build" />
<None Include="build\Mac.targets" Pack="True" PackagePath="build\Eto.Platform.XamMac2.targets" />
<None Include="build\Mac.props" Pack="True" PackagePath="build\Eto.Platform.XamMac2.props" />
<None Include="..\..\build\MSBuildTaskHelper.props" Pack="True" PackagePath="build" />
</ItemGroup>

<Import Project="..\..\build\Xamarin.Mac.targets" Condition="!$(TargetFramework.Contains('-macos'))" />
Expand Down
1 change: 0 additions & 1 deletion src/Eto.Mac/Eto.macOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ You do not need to use any of the classes of this assembly (unless customizing t
<None Include="build\*" Exclude="build\Mac.*" Pack="True" PackagePath="build" />
<None Include="build\Mac.targets" Pack="True" PackagePath="build\Eto.Platform.macOS.targets" />
<None Include="build\Mac.props" Pack="True" PackagePath="build\Eto.Platform.macOS.props" />
<None Include="..\..\build\MSBuildTaskHelper.props" Pack="True" PackagePath="build" />
</ItemGroup>

<Target Name="CheckSDKVersion" BeforeTargets="BeforeBuild">
Expand Down
2 changes: 0 additions & 2 deletions src/Eto.Mac/build/Mac.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<DebugType Condition="$(MacDebugEmbedded) == 'True'">embedded</DebugType>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'"/>

<PropertyGroup Condition="$(IsMac) == 'True'">
<MacBuildDmgDependsOnTargets>MacCreateDmg;MacBeautifyDmg</MacBuildDmgDependsOnTargets>
<MacCodeSignDependsOnTargets>MacCodeSignApp;MacCodeSignDmg</MacCodeSignDependsOnTargets>
Expand Down
11 changes: 2 additions & 9 deletions src/Eto.Mac/build/Mac.targets
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,8 @@
<RemoveDir Directories="$(OutputAppPath)"/>
</Target>

<PropertyGroup Condition="'$(MSBuildTaskFactoryType)'=='CodeTaskFactory'">
<_UpdatePListReference>System.Xml</_UpdatePListReference>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildTaskFactoryType)'!='CodeTaskFactory'">
<_UpdatePListReference>netstandard</_UpdatePListReference>
</PropertyGroup>

<!-- Task to update the plist file with new values -->
<UsingTask TaskName="UpdatePList" TaskFactory="$(MSBuildTaskFactoryType)" AssemblyFile="$(MSBuildTasksAssemblyFile)">
<UsingTask TaskName="UpdatePList" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<PListFile ParameterType="System.String" Required="true" />
<TargetFileName ParameterType="System.String" Required="true" />
Expand All @@ -92,7 +85,7 @@
<IconFile ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="$(_UpdatePListReference)"/>
<Reference Include="netstandard"/>
<Code Type="Class" Language="cs"><![CDATA[
using System;
using System.IO;
Expand Down
1 change: 0 additions & 1 deletion test/Eto.Test.Mac/Eto.Test.Mac64.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />

<Import Project="..\..\build\MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'" />
<Import Project="..\..\src\Eto.Mac\build\Mac.props" Condition="'$(ExcludeRestorePackageImports)' != 'true'" />

<PropertyGroup>
Expand Down