diff --git a/.github/workflows/validate_pull_request.yml b/.github/workflows/validate_pull_request.yml index b69013ff1..36a961369 100644 --- a/.github/workflows/validate_pull_request.yml +++ b/.github/workflows/validate_pull_request.yml @@ -25,11 +25,13 @@ jobs: - run: | dotnet tool restore dotnet csharpier . --check - build_msbuild: + test_msbuild: runs-on: ubuntu-latest name: Build CSharpier.MSBuild steps: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v3 - run: | - dotnet build Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj + dotnet pack Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj -o nupkg /p:Version=0.0.1 + dotnet build Src/Tests/CSharpier.MsBuild.Test + diff --git a/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln b/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln deleted file mode 100644 index 069fac837..000000000 --- a/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln +++ /dev/null @@ -1,16 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpier.MsBuild.Test", "CSharpier.MsBuild.Test.csproj", "{68C08C66-BB6C-4961-9298-7936549C4F20}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {68C08C66-BB6C-4961-9298-7936549C4F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68C08C66-BB6C-4961-9298-7936549C4F20}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68C08C66-BB6C-4961-9298-7936549C4F20}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68C08C66-BB6C-4961-9298-7936549C4F20}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/Tests/CSharpier.MsBuild.Test/Directory.Build.props b/Tests/CSharpier.MsBuild.Test/Directory.Build.props new file mode 100644 index 000000000..c1df2220d --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/Directory.Build.props @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Src/CSharpier.MsBuild.Test/Dockerfile b/Tests/CSharpier.MsBuild.Test/Dockerfile similarity index 73% rename from Src/CSharpier.MsBuild.Test/Dockerfile rename to Tests/CSharpier.MsBuild.Test/Dockerfile index fc599889c..265701c7a 100644 --- a/Src/CSharpier.MsBuild.Test/Dockerfile +++ b/Tests/CSharpier.MsBuild.Test/Dockerfile @@ -1,4 +1,6 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base + +COPY COPY nupkg ./nupkg COPY Src/CSharpier.MsBuild.Test ./Src/CSharpier.MsBuild.Test diff --git a/Tests/CSharpier.MsBuild.Test/dirs.csproj b/Tests/CSharpier.MsBuild.Test/dirs.csproj new file mode 100644 index 000000000..2e256849e --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/dirs.csproj @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Src/CSharpier.MsBuild.Test/Class.cs b/Tests/CSharpier.MsBuild.Test/net48/Class.cs similarity index 100% rename from Src/CSharpier.MsBuild.Test/Class.cs rename to Tests/CSharpier.MsBuild.Test/net48/Class.cs diff --git a/Tests/CSharpier.MsBuild.Test/net48/net48.csproj b/Tests/CSharpier.MsBuild.Test/net48/net48.csproj new file mode 100644 index 000000000..09fec49d8 --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/net48/net48.csproj @@ -0,0 +1,16 @@ + + + + false + library + net48 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/Tests/CSharpier.MsBuild.Test/net7.0/Class.cs b/Tests/CSharpier.MsBuild.Test/net7.0/Class.cs new file mode 100644 index 000000000..cc3cefc25 --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/net7.0/Class.cs @@ -0,0 +1 @@ +public class Class { } diff --git a/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.csproj b/Tests/CSharpier.MsBuild.Test/net7.0/net7.0.csproj similarity index 75% rename from Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.csproj rename to Tests/CSharpier.MsBuild.Test/net7.0/net7.0.csproj index e3fd2f9ae..0704b982f 100644 --- a/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.csproj +++ b/Tests/CSharpier.MsBuild.Test/net7.0/net7.0.csproj @@ -4,12 +4,10 @@ false library net7.0 - enable - enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/CSharpier.MsBuild.Test/net8.0/Class.cs b/Tests/CSharpier.MsBuild.Test/net8.0/Class.cs new file mode 100644 index 000000000..cc3cefc25 --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/net8.0/Class.cs @@ -0,0 +1 @@ +public class Class { } diff --git a/Tests/CSharpier.MsBuild.Test/net8.0/net8.0.csproj b/Tests/CSharpier.MsBuild.Test/net8.0/net8.0.csproj new file mode 100644 index 000000000..076aaca5f --- /dev/null +++ b/Tests/CSharpier.MsBuild.Test/net8.0/net8.0.csproj @@ -0,0 +1,16 @@ + + + + false + library + net8.0 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/Src/CSharpier.MsBuild.Test/nuget.config b/Tests/CSharpier.MsBuild.Test/nuget.config similarity index 100% rename from Src/CSharpier.MsBuild.Test/nuget.config rename to Tests/CSharpier.MsBuild.Test/nuget.config diff --git a/global.json b/global.json index 391ba3c2a..0c1d58f41 100644 --- a/global.json +++ b/global.json @@ -2,5 +2,8 @@ "sdk": { "version": "8.0.100", "rollForward": "latestFeature" + }, + "msbuild-sdks": { + "Microsoft.Build.Traversal": "4.1.0" } }