From dfa6ba01d4e6798f95b31c8cf4faf922dd6420dc Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Tue, 3 Sep 2024 18:08:03 -0400 Subject: [PATCH] Switch to CPM and update build/test dependencies --- .github/workflows/build.yml | 16 ++++------- .github/workflows/publish.yml | 2 +- Directory.Build.props | 6 ++-- Directory.Packages.props | 28 +++++++++++++++++++ .../MSBuildTestContext.cs | 4 ++- .../Mono.TextTemplating.Build.Tests.csproj | 24 ++++++---------- .../Mono.TextTemplating.Build.csproj | 8 +++--- .../Mono.TextTemplating.Roslyn.csproj | 2 +- .../Mono.TextTemplating.Tests.csproj | 6 ++-- .../Mono.TextTemplating.csproj | 5 ++-- TextTransform/TextTransform.csproj | 2 +- 11 files changed, 62 insertions(+), 41 deletions(-) create mode 100644 Directory.Packages.props diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76c8cf97..3a10cd53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,23 +15,19 @@ jobs: NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 # GitVersioning needs deep clone - name: Set up dotnet - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - - name: Find MSBuild - if: startsWith(matrix.os, 'windows') - uses: microsoft/setup-msbuild@v1.1.0 - - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ env.NUGET_PACKAGES }} key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -51,12 +47,12 @@ jobs: - name: Upload Test Results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "TestResults-${{ matrix.os }}-${{ matrix.config }}" path: "TestResults-${{ matrix.os }}-${{ matrix.config }}" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: matrix.config == 'Release' && startsWith(matrix.os, 'windows') with: name: packages diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dda45251..393e9657 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: publish: runs-on: windows-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: path: packages name: packages diff --git a/Directory.Build.props b/Directory.Build.props index 33b96ee4..cd3a16ca 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,8 @@ false $(MSBuildThisFileDirectory)packages\$(Configuration) true + true + true @@ -16,8 +18,8 @@ - - + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..cedfacc3 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mono.TextTemplating.Build.Tests/MSBuildTestContext.cs b/Mono.TextTemplating.Build.Tests/MSBuildTestContext.cs index a804144e..cb1aa41d 100644 --- a/Mono.TextTemplating.Build.Tests/MSBuildTestContext.cs +++ b/Mono.TextTemplating.Build.Tests/MSBuildTestContext.cs @@ -29,8 +29,10 @@ public MSBuildTestContext ([CallerMemberName] string testName = null, bool creat var globalProps = new Dictionary { { "ImportDirectoryBuildProps", "false" }, + { "ImportDirectoryBuildTargets", "false" }, { "TemplatingTargetsPath", buildTargetsProjectDir }, - { "TextTransformTaskAssembly", buildTasksPath } + { "TextTransformTaskAssembly", buildTasksPath }, + { "ManagePackageVersionsCentrally", "false" } }; Engine = new ProjectCollection (globalProps); diff --git a/Mono.TextTemplating.Build.Tests/Mono.TextTemplating.Build.Tests.csproj b/Mono.TextTemplating.Build.Tests/Mono.TextTemplating.Build.Tests.csproj index 9f81497c..011253eb 100644 --- a/Mono.TextTemplating.Build.Tests/Mono.TextTemplating.Build.Tests.csproj +++ b/Mono.TextTemplating.Build.Tests/Mono.TextTemplating.Build.Tests.csproj @@ -1,6 +1,6 @@ - net6.0;net7.0 + net6.0;net8.0 net48;$(TargetFrameworks) false $(DefaultItemExcludes);TestCases\** @@ -11,23 +11,17 @@ - - - - - - - - + + + + + - - - + + + diff --git a/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj b/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj index 81b90d27..41dccd3c 100644 --- a/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj +++ b/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj @@ -33,11 +33,11 @@ - - + + - - + + diff --git a/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj b/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj index 5b47239e..2c4e41a3 100644 --- a/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj +++ b/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj @@ -10,7 +10,7 @@ - + diff --git a/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj b/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj index 00bdac8b..3331d6d7 100644 --- a/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj +++ b/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/Mono.TextTemplating/Mono.TextTemplating.csproj b/Mono.TextTemplating/Mono.TextTemplating.csproj index b1188a86..6b74e8a2 100644 --- a/Mono.TextTemplating/Mono.TextTemplating.csproj +++ b/Mono.TextTemplating/Mono.TextTemplating.csproj @@ -2,7 +2,7 @@ netstandard2.0;net6.0;net472 true - 1591;1573 + $(NoWarn);1591;1573 $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) $(DefineConstants);FEATURE_APPDOMAINS $(DefineConstants);FEATURE_ASSEMBLY_LOAD_CONTEXT @@ -21,8 +21,7 @@ - - + diff --git a/TextTransform/TextTransform.csproj b/TextTransform/TextTransform.csproj index dde71b24..9696bcab 100644 --- a/TextTransform/TextTransform.csproj +++ b/TextTransform/TextTransform.csproj @@ -3,7 +3,7 @@ net472 Exe true - 1591;1573 + $(NoWarn);1591;1573 Mono.TextTemplating.Console True Command-line T4 text transform tool.