Skip to content

Commit

Permalink
trying to get msbuild tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Nov 16, 2023
1 parent fdc1cb6 commit 118dc06
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 22 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/validate_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 0 additions & 16 deletions Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln

This file was deleted.

2 changes: 2 additions & 0 deletions Tests/CSharpier.MsBuild.Test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions Tests/CSharpier.MsBuild.Test/dirs.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="**\*.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
16 changes: 16 additions & 0 deletions Tests/CSharpier.MsBuild.Test/net48/net48.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>library</OutputType>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions Tests/CSharpier.MsBuild.Test/net7.0/Class.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public class Class { }
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>library</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.0">
<PackageReference Include="CSharpier.MsBuild" Version="0.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1 change: 1 addition & 0 deletions Tests/CSharpier.MsBuild.Test/net8.0/Class.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public class Class { }
16 changes: 16 additions & 0 deletions Tests/CSharpier.MsBuild.Test/net8.0/net8.0.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>library</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
File renamed without changes.
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "4.1.0"
}
}

0 comments on commit 118dc06

Please sign in to comment.