Skip to content

Commit 1013b7c

Browse files
authored
feat: modernize to SDK-style project (#52)
* 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) - Preserve LibGit2Sharp native binary handling * fix: remove duplicate AssemblyInfo.cs for SDK-style project
1 parent abf6bd3 commit 1013b7c

File tree

6 files changed

+64
-175
lines changed

6 files changed

+64
-175
lines changed

.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.GitRanger/CodingWithCalvin.GitRanger.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.GitRanger/bin/Release/CodingWithCalvin.GitRanger.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.GitRanger/bin/Release/CodingWithCalvin.GitRanger.info
42+
src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.vsix

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: download-artifact
2727
uses: dawidd6/action-download-artifact@v6
2828
with:
29-
workflow: release_build_and_deploy.yml
29+
workflow: build.yml
3030
workflow_conclusion: success
3131

3232
- name: 2. Parse Artifact Manifest

.github/workflows/release_build_and_deploy.yml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ bld/
1010
[Oo]bj/
1111
[Ll]og/
1212
[Ll]ogs/
13+
Generated/
1314

1415
# Visual Studio files
1516
.vs/
Lines changed: 20 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,38 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
5-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6-
</PropertyGroup>
7-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="CodingWithCalvin.VsixSdk/0.3.0">
2+
83
<PropertyGroup>
9-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11-
<ProjectGuid>{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}</ProjectGuid>
12-
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
13-
<OutputType>Library</OutputType>
14-
<AppDesignerFolder>Properties</AppDesignerFolder>
4+
<TargetFramework>net48</TargetFramework>
155
<RootNamespace>CodingWithCalvin.GitRanger</RootNamespace>
166
<AssemblyName>CodingWithCalvin.GitRanger</AssemblyName>
17-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
18-
<FileAlignment>512</FileAlignment>
19-
<GeneratePkgDefFile>true</GeneratePkgDefFile>
20-
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
21-
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
22-
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
23-
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
24-
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
25-
<UseCodebase>true</UseCodebase>
267
<LangVersion>latest</LangVersion>
278
<Nullable>enable</Nullable>
28-
<DeployExtension Condition="'$(DeployExtension)' == ''">true</DeployExtension>
9+
<OutputPath>bin/$(Configuration)/</OutputPath>
2910
</PropertyGroup>
30-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
31-
<DebugSymbols>true</DebugSymbols>
32-
<DebugType>full</DebugType>
33-
<Optimize>false</Optimize>
34-
<OutputPath>bin\Debug\</OutputPath>
35-
<DefineConstants>DEBUG;TRACE</DefineConstants>
36-
<ErrorReport>prompt</ErrorReport>
37-
<WarningLevel>4</WarningLevel>
38-
</PropertyGroup>
39-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
40-
<DebugType>pdbonly</DebugType>
41-
<Optimize>true</Optimize>
42-
<OutputPath>bin\Release\</OutputPath>
43-
<DefineConstants>TRACE</DefineConstants>
44-
<ErrorReport>prompt</ErrorReport>
45-
<WarningLevel>4</WarningLevel>
11+
12+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
13+
<DeployExtension>True</DeployExtension>
4614
</PropertyGroup>
15+
4716
<ItemGroup>
48-
<Reference Include="PresentationCore" />
49-
<Reference Include="PresentationFramework" />
50-
<Reference Include="System" />
51-
<Reference Include="System.Core" />
52-
<Reference Include="System.Design" />
53-
<Reference Include="System.Drawing" />
54-
<Reference Include="System.Windows.Forms" />
55-
<Reference Include="System.Xaml" />
56-
<Reference Include="WindowsBase" />
57-
</ItemGroup>
58-
<ItemGroup>
59-
<Compile Include="GitRangerPackage.cs" />
60-
<Compile Include="source.extension.cs" />
61-
<Compile Include="Commands\BlameCommands.cs" />
62-
<Compile Include="Services\GitService.cs" />
63-
<Compile Include="Services\ThemeService.cs" />
64-
<Compile Include="Services\BlameService.cs" />
65-
<Compile Include="Options\GeneralOptionsPage.cs">
66-
<SubType>Component</SubType>
67-
</Compile>
68-
<Compile Include="Options\GeneralOptions.cs" />
69-
<Compile Include="Editor\BlameAdornment\BlameAdornmentFactory.cs" />
70-
<Compile Include="Editor\BlameAdornment\BlameAdornment.cs" />
71-
<Compile Include="Editor\GutterMargin\BlameMarginFactory.cs" />
72-
<Compile Include="Editor\GutterMargin\BlameMargin.cs" />
73-
<Compile Include="Models\BlameLineInfo.cs" />
74-
<Compile Include="Properties\AssemblyInfo.cs" />
75-
</ItemGroup>
76-
<ItemGroup>
77-
<None Include="source.extension.vsixmanifest">
78-
<SubType>Designer</SubType>
79-
</None>
17+
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.507" />
18+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" ExcludeAssets="runtime" />
19+
<PackageReference Include="LibGit2Sharp" Version="0.30.0" />
20+
<PackageReference Include="SkiaSharp" Version="2.88.7" />
21+
<PackageReference Include="SkiaSharp.Views.WPF" Version="2.88.7" />
8022
</ItemGroup>
23+
8124
<ItemGroup>
82-
<VSCTCompile Include="VSCommandTable.vsct">
83-
<ResourceName>Menus.ctmenu</ResourceName>
84-
<SubType>Designer</SubType>
85-
</VSCTCompile>
25+
<ProjectReference Include="..\CodingWithCalvin.GitRanger.Core\CodingWithCalvin.GitRanger.Core.csproj" />
8626
</ItemGroup>
27+
8728
<ItemGroup>
88-
<Content Include="..\..\resources\icon.png">
89-
<Link>Resources\icon.png</Link>
29+
<Content Include="..\..\resources\icon.png" Link="Resources\icon.png">
9030
<IncludeInVSIX>true</IncludeInVSIX>
91-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9231
</Content>
93-
<Content Include="..\..\LICENSE">
94-
<Link>Resources\LICENSE</Link>
32+
<Content Include="..\..\LICENSE" Link="Resources\LICENSE">
9533
<IncludeInVSIX>true</IncludeInVSIX>
9634
</Content>
9735
</ItemGroup>
98-
<ItemGroup>
99-
<ProjectReference Include="..\CodingWithCalvin.GitRanger.Core\CodingWithCalvin.GitRanger.Core.csproj">
100-
<Project>{B2C3D4E5-F6A7-8901-BCDE-F12345678901}</Project>
101-
<Name>CodingWithCalvin.GitRanger.Core</Name>
102-
</ProjectReference>
103-
</ItemGroup>
104-
<ItemGroup>
105-
<PackageReference Include="Community.VisualStudio.Toolkit.17">
106-
<Version>17.0.507</Version>
107-
</PackageReference>
108-
<PackageReference Include="Microsoft.VisualStudio.SDK">
109-
<Version>17.10.40171</Version>
110-
<ExcludeAssets>runtime</ExcludeAssets>
111-
</PackageReference>
112-
<PackageReference Include="Microsoft.VSSDK.BuildTools">
113-
<Version>17.10.2179</Version>
114-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
115-
<PrivateAssets>all</PrivateAssets>
116-
</PackageReference>
117-
<PackageReference Include="LibGit2Sharp">
118-
<Version>0.30.0</Version>
119-
</PackageReference>
120-
<PackageReference Include="SkiaSharp">
121-
<Version>2.88.7</Version>
122-
</PackageReference>
123-
<PackageReference Include="SkiaSharp.Views.WPF">
124-
<Version>2.88.7</Version>
125-
</PackageReference>
126-
</ItemGroup>
127-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
128-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />
12936

13037
<!-- Include LibGit2Sharp native binaries in VSIX -->
13138
<Target Name="IncludeLibGit2SharpNativeBinaries" AfterTargets="ResolveReferences">
@@ -144,4 +51,5 @@
14451
</Content>
14552
</ItemGroup>
14653
</Target>
147-
</Project>
54+
55+
</Project>

src/CodingWithCalvin.GitRanger/Properties/AssemblyInfo.cs

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

0 commit comments

Comments
 (0)