Skip to content

Commit 93b9449

Browse files
committed
Switch to CPM and update build/test dependencies
1 parent cb559e2 commit 93b9449

File tree

11 files changed

+62
-41
lines changed

11 files changed

+62
-41
lines changed

.github/workflows/build.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,19 @@ jobs:
1515
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
with:
2020
submodules: recursive
2121
fetch-depth: 0 # GitVersioning needs deep clone
2222

2323
- name: Set up dotnet
24-
uses: actions/setup-dotnet@v2
24+
uses: actions/setup-dotnet@v4
2525
with:
2626
dotnet-version: |
2727
6.0.x
28-
7.0.x
28+
8.0.x
2929
30-
- name: Find MSBuild
31-
if: startsWith(matrix.os, 'windows')
32-
uses: microsoft/setup-msbuild@v1.1.0
33-
34-
- uses: actions/cache@v3
30+
- uses: actions/cache@v4
3531
with:
3632
path: ${{ env.NUGET_PACKAGES }}
3733
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@@ -51,12 +47,12 @@ jobs:
5147

5248
- name: Upload Test Results
5349
if: failure()
54-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5551
with:
5652
name: "TestResults-${{ matrix.os }}-${{ matrix.config }}"
5753
path: "TestResults-${{ matrix.os }}-${{ matrix.config }}"
5854

59-
- uses: actions/upload-artifact@v3
55+
- uses: actions/upload-artifact@v4
6056
if: matrix.config == 'Release' && startsWith(matrix.os, 'windows')
6157
with:
6258
name: packages

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
publish:
1212
runs-on: windows-latest
1313
steps:
14-
- uses: actions/download-artifact@v3
14+
- uses: actions/download-artifact@v4
1515
with:
1616
path: packages
1717
name: packages

Directory.Build.props

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
88
<PackageOutputPath>$(MSBuildThisFileDirectory)packages\$(Configuration)</PackageOutputPath>
99
<EnablePackageValidation>true</EnablePackageValidation>
10+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
11+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
1012
</PropertyGroup>
1113

1214
<PropertyGroup>
@@ -16,8 +18,8 @@
1618
</PropertyGroup>
1719

1820
<ItemGroup>
19-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
20-
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
21+
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" />
22+
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="All"/>
2123
</ItemGroup>
2224

2325
<ItemGroup>

Directory.Packages.props

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
<ItemGroup>
3+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
4+
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
5+
<PackageVersion Include="Microsoft.Build" Version="17.3.2" />
6+
<PackageVersion Include="Microsoft.Build.Framework" Version="17.3.2" />
7+
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
8+
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="9.0.0" />
9+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
10+
<PackageVersion Include="xunit" Version="2.9.0" />
11+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
12+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.146" />
13+
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
14+
<PackageVersion Include="MessagePackAnalyzer" Version="2.5.192" />
15+
<PackageVersion Include="MessagePack" Version="2.5.192" />
16+
<!-- limit to 6.0 so that the MSBuild task can load on .NET 6.0 -->
17+
<PackageVersion Include="System.CodeDom" Version="6.0.0" />
18+
<!--
19+
Microsoft.NET.Test.Sdk brings in a version of NuGet.Frameworks that's older than the one used by MSBuild
20+
and loads first, thereby breaking loading of MSBuild assemblies. Force-upgrade it.
21+
-->
22+
<PackageVersion Include="NuGet.Frameworks" Version="6.12.1" />
23+
<!-- upgrade vulnerable transitive deps -->
24+
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
25+
<PackageVersion Include="System.Drawing.Common" Version="9.0.0" />
26+
27+
</ItemGroup>
28+
</Project>

Mono.TextTemplating.Build.Tests/MSBuildTestContext.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public MSBuildTestContext ([CallerMemberName] string testName = null, bool creat
2929

3030
var globalProps = new Dictionary<string, string> {
3131
{ "ImportDirectoryBuildProps", "false" },
32+
{ "ImportDirectoryBuildTargets", "false" },
3233
{ "TemplatingTargetsPath", buildTargetsProjectDir },
33-
{ "TextTransformTaskAssembly", buildTasksPath }
34+
{ "TextTransformTaskAssembly", buildTasksPath },
35+
{ "ManagePackageVersionsCentrally", "false" }
3436
};
3537

3638
Engine = new ProjectCollection (globalProps);

Mono.TextTemplating.Build.Tests/Mono.TextTemplating.Build.Tests.csproj

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
44
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net48;$(TargetFrameworks)</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<DefaultItemExcludes>$(DefaultItemExcludes);TestCases\**</DefaultItemExcludes>
@@ -11,23 +11,17 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.10" />
15-
<PackageReference Include="Microsoft.Build" Version="17.3.2" ExcludeAssets="runtime" />
16-
<PackageReference Include="Microsoft.Build.Framework" Version="17.3.2" ExcludeAssets="runtime" />
17-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" ExcludeAssets="runtime" />
18-
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="7.0.0" />
19-
<!--
20-
Microsoft.NET.Test.Sdk brings in a version of NuGet.Frameworks that's older than the one used by MSBuild
21-
and loads first, thereby breaking loading of MSBuild assemblies. Force-upgrade it.
22-
-->
23-
<PackageReference Include="NuGet.Frameworks" Version="6.9.1" />
24-
<PackageReference Include="System.Text.Json" Version="7.0.3" />
14+
<PackageReference Include="Microsoft.Build.Locator" />
15+
<PackageReference Include="Microsoft.Build" ExcludeAssets="runtime" />
16+
<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="runtime" />
17+
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" />
18+
<PackageReference Include="System.Reflection.MetadataLoadContext" />
2519
</ItemGroup>
2620

2721
<ItemGroup>
28-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
29-
<PackageReference Include="xunit" Version="2.5.1" />
30-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1" />
22+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
23+
<PackageReference Include="xunit" />
24+
<PackageReference Include="xunit.runner.visualstudio" />
3125
</ItemGroup>
3226

3327
<ItemGroup>

Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
<ItemGroup>
3434
<None Include="readme.md" Pack="true" PackagePath="\" />
3535
<ProjectReference Include="..\Mono.TextTemplating\Mono.TextTemplating.csproj" PrivateAssets="all" />
36-
<PackageReference Include="MessagePackAnalyzer" Version="2.5.129" PrivateAssets="all" />
37-
<PackageReference Include="MessagePack" Version="2.5.129" PrivateAssets="all" />
36+
<PackageReference Include="MessagePackAnalyzer" PrivateAssets="all" />
37+
<PackageReference Include="MessagePack" PrivateAssets="all" />
3838
<!-- intentionally downlevel these so they can be loaded in older VS versions -->
39-
<PackageReference Include="Microsoft.Build.Framework" Version="17.0.0" PrivateAssets="all" IncludeAssets="compile" />
40-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" PrivateAssets="all" IncludeAssets="compile" />
39+
<PackageReference Include="Microsoft.Build.Framework" VersionOverride="17.0.0" PrivateAssets="all" IncludeAssets="compile" />
40+
<PackageReference Include="Microsoft.Build.Utilities.Core" VersionOverride="17.0.0" PrivateAssets="all" IncludeAssets="compile" />
4141
</ItemGroup>
4242

4343
<!-- https://github.com/dotnet/msbuild/issues/4751-->

Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
13+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
1414
<None Include="readme.md" Pack="true" PackagePath="\" />
1515
<ProjectReference Include="..\Mono.TextTemplating\Mono.TextTemplating.csproj" />
1616
</ItemGroup>

Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
17-
<PackageReference Include="xunit" Version="2.5.1" />
18-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1" />
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
17+
<PackageReference Include="xunit" />
18+
<PackageReference Include="xunit.runner.visualstudio" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

Mono.TextTemplating/Mono.TextTemplating.csproj

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<NoWarn>1591;1573</NoWarn>
5+
<NoWarn>$(NoWarn);1591;1573</NoWarn>
66
<TFxId>$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))</TFxId>
77
<DefineConstants Condition="'$(TFxId)'=='.NETFramework'">$(DefineConstants);FEATURE_APPDOMAINS</DefineConstants>
88
<DefineConstants Condition="'$(TFxId)'=='.NETCoreApp'">$(DefineConstants);FEATURE_ASSEMBLY_LOAD_CONTEXT</DefineConstants>
@@ -21,8 +21,7 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<!-- limit to 6.0 so that the MSBuild task can load on .NET 6.0 -->
25-
<PackageReference Include="System.CodeDom" Version="6.0.0" Condition="'$(TargetFramework)'!='net472'" />
24+
<PackageReference Include="System.CodeDom" Condition="'$(TargetFramework)'!='net472'" />
2625
<None Include="readme.md" Pack="true" PackagePath="\" />
2726
<None Include="package\Mono.TextTemplating.targets" Pack="true" PackagePath="buildTransitive\Mono.TextTemplating.targets" />
2827
</ItemGroup>

TextTransform/TextTransform.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>net472</TargetFramework>
44
<OutputType>Exe</OutputType>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6-
<NoWarn>1591;1573</NoWarn>
6+
<NoWarn>$(NoWarn);1591;1573</NoWarn>
77
<PackageId>Mono.TextTemplating.Console</PackageId>
88
<IsTool>True</IsTool>
99
<Description>Command-line T4 text transform tool.</Description>

0 commit comments

Comments
 (0)