Skip to content

Commit 5465d86

Browse files
authored
feat(sdk): update to 0.3.0 (#24)
1 parent 7b9816b commit 5465d86

File tree

10 files changed

+72
-215
lines changed

10 files changed

+72
-215
lines changed
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
name: 'Build and Deploy'
2-
2+
33
on:
44
workflow_dispatch:
55
pull_request:
66
types: [opened, reopened]
77
push:
8-
branches:
8+
branches:
99
- main
10-
10+
1111
jobs:
12-
Release-Build-and-Deploy:
12+
Release-Build-and-Deploy:
1313
runs-on: windows-latest
14-
14+
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: microsoft/setup-msbuild@v2
18-
- uses: nuget/setup-nuget@v2
1917

20-
- name: 1. Versioning Release
21-
id: step-version
22-
uses: CodingWithCalvin/GHA-VSVsixVersioner@v1
23-
with:
24-
extension-manifest-file: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest'
25-
extension-source-file: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs'
26-
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+
Write-Host "Generated version: $version"
27+
shell: pwsh
28+
2729
- name: 2. Inject Honeycomb API Key
2830
run: |
2931
$file = 'src/CodingWithCalvin.OpenInNotepadPlusPlus/HoneycombConfig.cs'
@@ -32,21 +34,18 @@ jobs:
3234
Set-Content $file $content
3335
shell: pwsh
3436

35-
- name: 3. Restoring Packages
36-
run: nuget restore ./src/CodingWithCalvin.OpenInNotepadPlusPlus.slnx
37-
38-
- name: 4. Building Project
39-
run: msbuild 'src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj' /p:configuration='Release' /p:platform=AnyCPU /p:DeployExtension=False
37+
- name: 3. Building Project
38+
run: dotnet build src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj -c Release -p:Version=${{ steps.version.outputs.version }}
4039

41-
- name: 5. Create Information File
40+
- name: 4. Create Information File
4241
uses: jsdaniell/create-json@v1.2.3
4342
with:
44-
name: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.info'
45-
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.step-version.outputs.version }}"}'
43+
name: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.info'
44+
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}'
4645

47-
- name: 6. Publishing Build Artifact
46+
- name: 5. Publishing Build Artifact
4847
uses: actions/upload-artifact@v4
4948
with:
5049
path: |
51-
src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.info
52-
src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.vsix
50+
src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.info
51+
src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.vsix

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,5 @@ $RECYCLE.BIN/
156156
# Claude Code local settings
157157
.claude/
158158
CLAUDE.local.md
159+
160+
src/**/*.g.cs
Lines changed: 15 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,30 @@
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-
</PropertyGroup>
8-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
9-
<OutputPath>bin\Release\</OutputPath>
10-
<DefineConstants>
11-
</DefineConstants>
12-
<Optimize>true</Optimize>
13-
<PlatformTarget>AnyCPU</PlatformTarget>
14-
<LangVersion>latest</LangVersion>
15-
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
16-
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
18-
<DebugSymbols>true</DebugSymbols>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>TRACE;DEBUG</DefineConstants>
21-
<DebugType>full</DebugType>
22-
<PlatformTarget>AnyCPU</PlatformTarget>
23-
<LangVersion>latest</LangVersion>
24-
<DeployExtension>True</DeployExtension>
25-
<UseWinFormsOutOfProcDesigner>False</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>{ADD4175C-AA5C-49E4-AFAF-6B9D3E832E8D}</ProjectGuid>
34-
<OutputType>Library</OutputType>
35-
<AppDesignerFolder>Properties</AppDesignerFolder>
4+
<TargetFramework>net48</TargetFramework>
365
<RootNamespace>CodingWithCalvin.OpenInNotepadPlusPlus</RootNamespace>
376
<AssemblyName>CodingWithCalvin.OpenInNotepadPlusPlus</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>
457
<LangVersion>latest</LangVersion>
46-
<StartAction>Program</StartAction>
47-
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
48-
<StartArguments>/rootsuffix Exp</StartArguments>
49-
<VsixType>v3</VsixType>
508
</PropertyGroup>
9+
10+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
11+
<DeployExtension>True</DeployExtension>
12+
</PropertyGroup>
13+
5114
<ItemGroup>
52-
<PackageReference Include="Microsoft.VisualStudio.SDK">
53-
<Version>17.14.40265</Version>
54-
</PackageReference>
55-
<PackageReference Include="Microsoft.VSSDK.BuildTools">
56-
<Version>17.14.2120</Version>
57-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
58-
</PackageReference>
59-
<PackageReference Include="CodingWithCalvin.Otel4Vsix">
60-
<Version>0.2.0</Version>
61-
</PackageReference>
62-
</ItemGroup>
63-
<ItemGroup>
64-
<Reference Include="System" />
65-
<Reference Include="System.Design" />
66-
<Reference Include="System.Windows.Forms" />
67-
<Reference Include="Microsoft.CSharp" />
68-
</ItemGroup>
69-
<ItemGroup>
70-
<None Include="source.extension.vsixmanifest">
71-
<SubType>Designer</SubType>
72-
<Generator>VsixManifestGenerator</Generator>
73-
<LastGenOutput>source.extension.cs</LastGenOutput>
74-
</None>
15+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
16+
<PackageReference Include="CodingWithCalvin.Otel4Vsix" Version="0.2.0" />
7517
</ItemGroup>
18+
7619
<ItemGroup>
77-
<Content Include="..\..\resources\icon.png">
78-
<Link>resources\icon.png</Link>
20+
<Content Include="..\..\resources\icon.png" Link="resources\icon.png">
7921
<IncludeInVSIX>true</IncludeInVSIX>
8022
</Content>
81-
<Content Include="..\..\LICENSE">
82-
<Link>resources\LICENSE</Link>
23+
<Content Include="..\..\LICENSE" Link="resources\LICENSE">
8324
<IncludeInVSIX>true</IncludeInVSIX>
8425
</Content>
85-
<Content Include="..\..\resources\logo.png">
86-
<Link>resources\logo.png</Link>
26+
<Content Include="..\..\resources\logo.png" Link="resources\logo.png">
8727
<IncludeInVSIX>true</IncludeInVSIX>
8828
</Content>
8929
</ItemGroup>
90-
<ItemGroup>
91-
<VSCTCompile Include="VSCommandTable.vsct">
92-
<ResourceName>Menus.ctmenu</ResourceName>
93-
<Generator>VsctGenerator</Generator>
94-
<LastGenOutput>VSCommandTable.cs</LastGenOutput>
95-
</VSCTCompile>
96-
</ItemGroup>
97-
<ItemGroup />
98-
<ItemGroup>
99-
<Compile Include="Commands\OpenExecutableCommand.cs" />
100-
<Compile Include="Dialogs\SettingsDialogPage.cs">
101-
<SubType>Component</SubType>
102-
</Compile>
103-
<Compile Include="Helpers\ProjectHelpers.cs" />
104-
<Compile Include="OpenInNotepadPlusPlusPackage.cs" />
105-
<Compile Include="HoneycombConfig.cs" />
106-
<Compile Include="Properties\AssemblyInfo.cs" />
107-
<Compile Include="source.extension.cs">
108-
<AutoGen>True</AutoGen>
109-
<DesignTime>True</DesignTime>
110-
<DependentUpon>source.extension.vsixmanifest</DependentUpon>
111-
</Compile>
112-
<Compile Include="VSCommandTable.cs">
113-
<AutoGen>True</AutoGen>
114-
<DesignTime>True</DesignTime>
115-
<DependentUpon>VSCommandTable.vsct</DependentUpon>
116-
</Compile>
117-
</ItemGroup>
118-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
119-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
120-
</Project>
30+
</Project>

src/CodingWithCalvin.OpenInNotepadPlusPlus/Commands/OpenExecutableCommand.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel.Design;
4-
using System.Diagnostics;
5-
using System.Windows.Forms;
6-
using CodingWithCalvin.OpenInNotepadPlusPlus.Dialogs;
1+
using CodingWithCalvin.OpenInNotepadPlusPlus.Dialogs;
72
using CodingWithCalvin.OpenInNotepadPlusPlus.Helpers;
83
using CodingWithCalvin.Otel4Vsix;
94
using EnvDTE;
105
using EnvDTE80;
116
using Microsoft.VisualStudio.Shell;
7+
using System;
8+
using System.Collections.Generic;
9+
using System.ComponentModel.Design;
10+
using System.Diagnostics;
11+
using System.Windows.Forms;
12+
using static CodingWithCalvin.OpenInNotepadPlusPlus.VSCommandTableVsct;
1213

1314
namespace CodingWithCalvin.OpenInNotepadPlusPlus.Commands
1415
{
@@ -28,8 +29,8 @@ private OpenExecutableCommand(Package package, SettingsDialogPage settings)
2829
if (commandService != null)
2930
{
3031
var menuCommandId = new CommandID(
31-
PackageGuids.guidOpenInNppCmdSet,
32-
PackageIds.OpenInNpp
32+
guidOpenInNppCmdSet.Guid,
33+
guidOpenInNppCmdSet.OpenInNpp
3334
);
3435
var menuItem = new MenuCommand(OpenPath, menuCommandId);
3536
commandService.AddCommand(menuItem);
@@ -47,12 +48,13 @@ public static void Initialize(Package package, SettingsDialogPage settings)
4748

4849
private void OpenPath(object sender, EventArgs e)
4950
{
51+
ThreadHelper.ThrowIfNotOnUIThread();
52+
5053
using var activity = VsixTelemetry.StartCommandActivity("OpenInNotepadPlusPlus.OpenPath");
5154

5255
var service = (DTE2)this.ServiceProvider.GetService(typeof(DTE));
5356
try
5457
{
55-
ThreadHelper.ThrowIfNotOnUIThread();
5658
var selectedFilePath = ProjectHelpers.GetSelectedPath(service);
5759
var executablePath = _settings.FolderPath;
5860

@@ -91,10 +93,7 @@ private static void OpenExecutable(string executablePath, string selectedFilePat
9193
WindowStyle = ProcessWindowStyle.Hidden
9294
};
9395

94-
using (System.Diagnostics.Process.Start(startInfo))
95-
{
96-
//TODO : Should this be empty?
97-
}
96+
using (System.Diagnostics.Process.Start(startInfo)) {}
9897
}
9998
}
10099
}

src/CodingWithCalvin.OpenInNotepadPlusPlus/OpenInNotepadPlusPlusPackage.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
namespace CodingWithCalvin.OpenInNotepadPlusPlus
1010
{
1111
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
12-
[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
12+
[InstalledProductRegistration(VsixInfo.DisplayName, VsixInfo.Description, VsixInfo.Version)]
1313
[ProvideOptionPage(
1414
typeof(SettingsDialogPage),
15-
Vsix.Name,
15+
VsixInfo.DisplayName,
1616
"General",
1717
101,
1818
111,
@@ -21,7 +21,7 @@ namespace CodingWithCalvin.OpenInNotepadPlusPlus
2121
ProvidesLocalizedCategoryName = false
2222
)]
2323
[ProvideMenuResource("Menus.ctmenu", 1)]
24-
[Guid(PackageGuids.guidPackageString)]
24+
[Guid("6AEABF47-7BDC-47B3-ADE7-06F5BAE6D868")]
2525
public sealed class OpenInNotepadPlusPlusPackage : AsyncPackage
2626
{
2727
protected override async System.Threading.Tasks.Task InitializeAsync(
@@ -34,8 +34,8 @@ IProgress<ServiceProgressData> progress
3434
var settings = (SettingsDialogPage)this.GetDialogPage(typeof(SettingsDialogPage));
3535

3636
var builder = VsixTelemetry.Configure()
37-
.WithServiceName(Vsix.Name)
38-
.WithServiceVersion(Vsix.Version)
37+
.WithServiceName(VsixInfo.DisplayName)
38+
.WithServiceVersion(VsixInfo.Version)
3939
.WithVisualStudioAttributes(this)
4040
.WithEnvironmentAttributes();
4141

src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"Start Experimental Instance": {
4+
"commandName": "Executable",
5+
"executablePath": "C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\Common7\\IDE\\devenv.exe",
6+
"commandLineArgs": "/rootSuffix Exp"
7+
}
8+
}
9+
}

src/CodingWithCalvin.OpenInNotepadPlusPlus/VSCommandTable.cs

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

src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs

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

0 commit comments

Comments
 (0)