Skip to content

Commit 4cac573

Browse files
authored
feat: modernize to SDK-style project (#14)
* feat: modernize to SDK-style project - Convert .csproj to SDK-style using CodingWithCalvin.VsixSdk/0.3.0 - Standardize output path to bin/$(Configuration)/ - Replace msbuild workflow with dotnet build - Rename build workflow from release_build_and_deploy.yml to build.yml - Use CalVer versioning (YYYY.M.D.RunNumber) * fix: remove duplicate AssemblyInfo.cs for SDK-style project
1 parent 3249429 commit 4cac573

6 files changed

Lines changed: 63 additions & 144 deletions

File tree

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened]
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: 1. Generate Version
19+
id: version
20+
run: |
21+
$year = (Get-Date).Year
22+
$month = (Get-Date).Month
23+
$day = (Get-Date).Day
24+
$version = "$year.$month.$day.${{ github.run_number }}"
25+
echo "version=$version" >> $env:GITHUB_OUTPUT
26+
shell: pwsh
27+
28+
- name: 2. Build Project
29+
run: dotnet build src/CodingWithCalvin.BreakpointNotifier/CodingWithCalvin.BreakpointNotifier.csproj -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }}
30+
31+
- name: 3. Create Information File
32+
uses: jsdaniell/create-json@v1.2.3
33+
with:
34+
name: 'src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.info'
35+
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}'
36+
37+
- name: 4. Upload Artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
path: |
41+
src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.info
42+
src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.vsix

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919

2020
- name: 1. Download artifact
2121
id: download-artifact
22-
uses: dawidd6/action-download-artifact@v2
22+
uses: dawidd6/action-download-artifact@v6
2323
with:
24-
workflow: release_build_and_deploy.yml
24+
workflow: build.yml
2525
workflow_conclusion: success
2626

2727
- name: 2. Parse Artifact Manifest

.github/workflows/release_build_and_deploy.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ orleans.codegen.cs
183183
# RIA/Silverlight projects
184184
Generated_Code/
185185

186+
# SDK-style project generated files
187+
Generated/
188+
186189
# Backup & report files from converting an old project file
187190
# to a newer Visual Studio version. Backup files are not needed,
188191
# because we have git ;-)
Lines changed: 16 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,28 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="CodingWithCalvin.VsixSdk/0.3.0">
2+
33
<PropertyGroup>
4-
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
5-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6-
<UseCodebase>true</UseCodebase>
7-
<TargetFrameworkProfile />
8-
</PropertyGroup>
9-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
10-
<DebugSymbols>true</DebugSymbols>
11-
<OutputPath>bin\Debug\</OutputPath>
12-
<DefineConstants>TRACE;DEBUG</DefineConstants>
13-
<DebugType>full</DebugType>
14-
<PlatformTarget>AnyCPU</PlatformTarget>
15-
<LangVersion>latest</LangVersion>
16-
<UseWinFormsOutOfProcDesigner>True</UseWinFormsOutOfProcDesigner>
17-
</PropertyGroup>
18-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
19-
<DebugSymbols>true</DebugSymbols>
20-
<OutputPath>bin\Release\</OutputPath>
21-
<DebugType>full</DebugType>
22-
<PlatformTarget>AnyCPU</PlatformTarget>
23-
<LangVersion>latest</LangVersion>
24-
<Optimize>true</Optimize>
25-
<UseWinFormsOutOfProcDesigner>True</UseWinFormsOutOfProcDesigner>
26-
</PropertyGroup>
27-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
28-
<PropertyGroup>
29-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
30-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
31-
<SchemaVersion>2.0</SchemaVersion>
32-
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
33-
<ProjectGuid>{66C238AD-8111-4579-A40C-48859AB61F25}</ProjectGuid>
34-
<OutputType>Library</OutputType>
35-
<AppDesignerFolder>Properties</AppDesignerFolder>
4+
<TargetFramework>net48</TargetFramework>
365
<RootNamespace>CodingWithCalvin.BreakpointNotifier</RootNamespace>
376
<AssemblyName>CodingWithCalvin.BreakpointNotifier</AssemblyName>
38-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
39-
<GeneratePkgDefFile>true</GeneratePkgDefFile>
40-
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
41-
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
42-
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
43-
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
44-
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
45-
<StartAction>Program</StartAction>
46-
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
47-
<StartArguments>/rootsuffix Exp</StartArguments>
48-
<VsixType>v3</VsixType>
7+
<LangVersion>latest</LangVersion>
8+
<OutputPath>bin/$(Configuration)/</OutputPath>
499
</PropertyGroup>
10+
11+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
12+
<DeployExtension>True</DeployExtension>
13+
</PropertyGroup>
14+
5015
<ItemGroup>
51-
<Compile Include="BreakpointNotifierPackage.cs" />
52-
<Compile Include="DebuggerEvents.cs" />
53-
<Compile Include="Properties\AssemblyInfo.cs" />
54-
<Compile Include="source.extension.cs">
55-
<AutoGen>True</AutoGen>
56-
<DesignTime>True</DesignTime>
57-
<DependentUpon>source.extension.vsixmanifest</DependentUpon>
58-
</Compile>
16+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
5917
</ItemGroup>
18+
6019
<ItemGroup>
61-
<Content Include="..\..\LICENSE">
62-
<Link>resources\LICENSE</Link>
20+
<Content Include="..\..\resources\logo.png" Link="resources\logo.png">
6321
<IncludeInVSIX>true</IncludeInVSIX>
6422
</Content>
65-
<None Include="source.extension.vsixmanifest">
66-
<SubType>Designer</SubType>
67-
<Generator>VsixManifestGenerator</Generator>
68-
<LastGenOutput>source.extension.cs</LastGenOutput>
69-
</None>
70-
</ItemGroup>
71-
<ItemGroup>
72-
<Reference Include="Microsoft.CSharp" />
73-
<Reference Include="System" />
74-
<Reference Include="System.Design" />
75-
<Reference Include="System.Windows.Forms" />
76-
</ItemGroup>
77-
<ItemGroup>
78-
<PackageReference Include="Microsoft.VisualStudio.SDK">
79-
<Version>17.14.40265</Version>
80-
</PackageReference>
81-
<PackageReference Include="Microsoft.VSSDK.BuildTools">
82-
<Version>17.14.2120</Version>
83-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
84-
</PackageReference>
85-
</ItemGroup>
86-
<ItemGroup />
87-
<ItemGroup>
88-
<Content Include="..\..\resources\logo.png">
89-
<Link>resources\logo.png</Link>
23+
<Content Include="..\..\LICENSE" Link="resources\LICENSE">
9024
<IncludeInVSIX>true</IncludeInVSIX>
9125
</Content>
9226
</ItemGroup>
93-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
94-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
95-
</Project>
27+
28+
</Project>

src/CodingWithCalvin.BreakpointNotifier/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)