Skip to content

Commit 152d3ae

Browse files
authored
Merge pull request #7 from reduckted/feature/dotnet-sdk
Feature/dotnet sdk
2 parents 86e93ee + bdb2f1a commit 152d3ae

File tree

7 files changed

+29
-72
lines changed

7 files changed

+29
-72
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: Continuous Integration
22

33
on:
4-
push:
5-
branches:
6-
- "**"
7-
8-
tags-ignore:
9-
- "**"
10-
114
pull_request:
125
types: [opened, synchronize, edited]
136

@@ -21,13 +14,13 @@ jobs:
2114

2215
steps:
2316
- name: Checkout
24-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
2518

26-
- name: Setup MSBuild
27-
uses: microsoft/setup-msbuild@v1.0.2
19+
- name: Setup .NET SDK
20+
uses: actions/setup-dotnet@v4
2821

2922
- name: Build
30-
run: msbuild /t:Rebuild /Restore /v:Minimal
23+
run: dotnet build
3124

3225
- name: Test
33-
run: msbuild tests/ProjectFilter.UnitTests /t:Test /v:Minimal
26+
run: dotnet test tests/ProjectFilter.UnitTests

Directory.Build.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<Project>
22

33
<PropertyGroup>
4-
<LangVersion>10</LangVersion>
4+
<Version>2.5.0</Version>
5+
<TargetFramework>net48</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<LangVersion>10.0</LangVersion>
8+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
59
</PropertyGroup>
610

711
</Project>

ProjectFilter.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".solution", ".solution", "{
1515
.editorconfig = .editorconfig
1616
CHANGELOG.md = CHANGELOG.md
1717
Directory.Build.props = Directory.Build.props
18+
global.json = global.json
1819
nuget.config = nuget.config
1920
README.md = README.md
2021
EndProjectSection

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.200"
4+
}
5+
}

source/ProjectFilter/ProjectFilter.csproj

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
<Project>
2-
3-
<Import Sdk="Microsoft.NET.Sdk.WindowsDesktop" Project="Sdk.props" />
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
42

53
<PropertyGroup>
6-
<TargetFramework>net48</TargetFramework>
7-
<RootNamespace>ProjectFilter</RootNamespace>
8-
<UseWPF>true</UseWPF>
9-
<Nullable>enable</Nullable>
10-
<LangVersion>10.0</LangVersion>
11-
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
4+
<CustomAfterMicrosoftCSharpTargets Condition="$(VsSDKInstall) != ''">$(VsSDKInstall)\Microsoft.VsSDK.targets</CustomAfterMicrosoftCSharpTargets>
125
</PropertyGroup>
136

147
<PropertyGroup>
15-
<Version>2.5.0</Version>
8+
<RootNamespace>ProjectFilter</RootNamespace>
9+
<UseWPF>true</UseWPF>
1610
</PropertyGroup>
1711

1812
<PropertyGroup>
@@ -86,15 +80,15 @@
8680
<PrivateAssets>all</PrivateAssets>
8781
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8882
</PackageReference>
89-
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.507" />
90-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
83+
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.527" />
84+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
9185
<PrivateAssets>all</PrivateAssets>
9286
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9387
</PackageReference>
9488
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.32112.339" ExcludeAssets="runtime">
9589
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9690
</PackageReference>
97-
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.3.2094">
91+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.13.2126">
9892
<PrivateAssets>all</PrivateAssets>
9993
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
10094
</PackageReference>
@@ -108,33 +102,8 @@
108102
<Reference Include="WindowsBase" />
109103
</ItemGroup>
110104

111-
<PropertyGroup>
112-
<!--
113-
Configure the `PostBuildEvent` target to always run. This gives us a
114-
target that we can restore the manifest file in, even if the build fails.
115-
-->
116-
<RunPostBuildEvent>Always</RunPostBuildEvent>
117-
</PropertyGroup>
118-
119-
<Target Name="SetVsixVersion" BeforeTargets="BeforeBuild">
120-
<!--
121-
We only want to change the version number during
122-
the build, so backup the manifest file first.
123-
-->
124-
<PropertyGroup>
125-
<VsixManifestOriginal>source.extension.vsixmanifest</VsixManifestOriginal>
126-
<VsixManifestBackup>$(IntermediateOutputPath)$(VsixManifestOriginal).backup</VsixManifestBackup>
127-
</PropertyGroup>
128-
129-
<Copy SourceFiles="$(VsixManifestOriginal)" DestinationFiles="$(VsixManifestBackup)" />
130-
<XmlPoke XmlInputPath="source.extension.vsixmanifest" Query="/x:PackageManifest/x:Metadata/x:Identity/@Version" Value="$(Version)" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
131-
</Target>
132-
133-
<Target Name="RestoreVsixVersion" AfterTargets="PostBuildEvent">
134-
<!-- Restore the backup of the manifest file. -->
135-
<Move SourceFiles="$(VsixManifestBackup)" DestinationFiles="$(VsixManifestOriginal)" />
136-
</Target>
137-
105+
<Target Name="VsixVersion" Returns="$(Version)" />
106+
138107
<!-- Workaround for https://github.com/dotnet/wpf/issues/6792 -->
139108
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
140109
<ItemGroup>
@@ -144,7 +113,4 @@
144113
</ItemGroup>
145114
</Target>
146115

147-
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
148-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />
149-
150116
</Project>

source/ProjectFilter/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="ProjectFilter.76800882-6e41-4df7-9db4-1945655b2620" Version="1.0" Language="en-US" Publisher="reduckted" />
4+
<Identity Id="ProjectFilter.76800882-6e41-4df7-9db4-1945655b2620" Version="|%CurrentProject%;VsixVersion|" Language="en-US" Publisher="reduckted" />
55
<DisplayName>Project Filter</DisplayName>
66
<Description xml:space="preserve">Quickly load and unload projects.</Description>
77
<MoreInfo>https://github.com/reduckted/ProjectFilter</MoreInfo>
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net48</TargetFramework>
54
<RootNamespace>ProjectFilter</RootNamespace>
65
<IsPackable>false</IsPackable>
7-
<Nullable>enable</Nullable>
8-
<LangVersion>10.0</LangVersion>
9-
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
106
</PropertyGroup>
117

128
<ItemGroup>
13-
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.507" />
14-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
9+
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.527" />
10+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
1511
<PrivateAssets>all</PrivateAssets>
1612
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1713
</PackageReference>
@@ -21,10 +17,6 @@
2117
<PackageReference Include="Microsoft.VisualStudio.Sdk.TestFramework.Xunit" Version="17.2.7" />
2218
<PackageReference Include="NSubstitute" Version="5.1.0" />
2319
<PackageReference Include="xunit" Version="2.6.3" />
24-
<PackageReference Include="xunit.runner.msbuild" Version="2.6.3">
25-
<PrivateAssets>all</PrivateAssets>
26-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27-
</PackageReference>
2820
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
2921
<PrivateAssets>all</PrivateAssets>
3022
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -40,8 +32,4 @@
4032
<Reference Include="System.Xaml" />
4133
</ItemGroup>
4234

43-
<Target Name="Test">
44-
<xunit Assemblies="$(TargetPath)" />
45-
</Target>
46-
4735
</Project>

0 commit comments

Comments
 (0)