Skip to content

Commit 0dcb2fc

Browse files
committed
Build for Dev18 Visual Studio 2026
1 parent 98df8e7 commit 0dcb2fc

25 files changed

+2788
-3
lines changed

.github/workflows/on_push.yml

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,58 @@ jobs:
146146
ref: "tags/${{ needs.version.outputs.semver }}"
147147
})
148148
149+
build-dev18:
150+
name: Build Dev18
151+
runs-on: windows-2019
152+
needs: [version]
153+
steps:
154+
-
155+
name: Checkout
156+
uses: actions/checkout@v4
157+
-
158+
name: Setup MSBuild
159+
uses: microsoft/setup-msbuild@v1
160+
-
161+
name: Setup NuGet
162+
uses: NuGet/setup-nuget@v1
163+
-
164+
name: Restore NuGet packages
165+
run: nuget restore ./Dev18/Dev18.csproj -PackagesDirectory ./packages -NonInteractive
166+
-
167+
name: Update version
168+
run: |
169+
(Get-Content -Path Dev18\source.extension.vsixmanifest) |
170+
ForEach-Object {$_ -Replace '1.0.0', '${{ needs.version.outputs.semver }}'} |
171+
Set-Content -Path Dev18\source.extension.vsixmanifest
172+
(Get-Content -Path Dev18\Properties\AssemblyInfo.cs) |
173+
ForEach-Object {$_ -Replace '1.0.0', '${{ needs.version.outputs.semver }}'} |
174+
Set-Content -Path Dev18\Properties\AssemblyInfo.cs
175+
-
176+
name: Build Dev18 for Release
177+
run: msbuild Dev18/Dev18.csproj -property:Configuration=Release -property:platform="x64" -property:DeployExtension=false
178+
-
179+
name: Upload artifacts
180+
uses: actions/upload-artifact@v4
181+
with:
182+
name: WakaTime.Dev18.vsix
183+
path: Dev18/bin/x64/Release/WakaTime.Dev18.vsix
184+
-
185+
name: Remove tag if failure
186+
if: ${{ failure() }}
187+
uses: actions/github-script@v7
188+
with:
189+
github-token: ${{ github.token }}
190+
script: |
191+
github.rest.git.deleteRef({
192+
owner: context.repo.owner,
193+
repo: context.repo.repo,
194+
ref: "tags/${{ needs.version.outputs.semver }}"
195+
})
196+
149197
publish-dev16:
150198
name: Publish Dev16
151199
runs-on: windows-latest
152-
needs: [build-dev16, build-dev17] # set dependencies for both build steps to ensure both ran correctly and didn't delete the tag in case of failure
200+
needs: [build-dev16, build-dev17, build-dev18] # set dependencies for all build steps to ensure all ran correctly and didn't delete the tag in case of failure
153201
steps:
154202
-
155203
name: Checkout
@@ -171,7 +219,7 @@ jobs:
171219
publish-dev17:
172220
name: Publish Dev17
173221
runs-on: windows-latest
174-
needs: [build-dev16, build-dev17] # set dependencies for both build steps to ensure both ran correctly and didn't delete the tag in case of failure
222+
needs: [build-dev16, build-dev17, build-dev18] # set dependencies for all build steps to ensure all ran correctly and didn't delete the tag in case of failure
175223
steps:
176224
-
177225
name: Checkout
@@ -190,10 +238,32 @@ jobs:
190238
publish-manifest-file: Dev17\publishManifest.json
191239
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
192240

241+
publish-dev18:
242+
name: Publish Dev18
243+
runs-on: windows-latest
244+
needs: [build-dev16, build-dev17, build-dev18] # set dependencies for all build steps to ensure all ran correctly and didn't delete the tag in case of failure
245+
steps:
246+
-
247+
name: Checkout
248+
uses: actions/checkout@v4
249+
-
250+
name: Download artifacts
251+
uses: actions/download-artifact@v4
252+
with:
253+
pattern: "*.Dev18.vsix"
254+
path: build/
255+
-
256+
name: Publish Dev18 to Marketplace
257+
uses: cezarypiatek/VsixPublisherAction@1.1
258+
with:
259+
extension-file: ${{ github.workspace }}\build\WakaTime.Dev18.vsix\WakaTime.Dev18.vsix
260+
publish-manifest-file: Dev18\publishManifest.json
261+
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
262+
193263
release:
194264
name: Release
195265
runs-on: ubuntu-latest
196-
needs: [version, publish-dev16, publish-dev17]
266+
needs: [version, publish-dev16, publish-dev17, publish-dev18]
197267
steps:
198268
-
199269
name: Checkout

Dev18/Assets/dashboard.png

97.1 KB
Loading

Dev18/Assets/output-window.png

46.4 KB
Loading

Dev18/Assets/wakatime-120.ico

31.3 KB
Binary file not shown.

Dev18/Assets/wakatime-120.png

5.42 KB
Loading

Dev18/Assets/wakatime-16.png

660 Bytes
Loading

Dev18/Dev18.csproj

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
<TargetFrameworkProfile />
7+
</PropertyGroup>
8+
<PropertyGroup>
9+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
10+
</PropertyGroup>
11+
<PropertyGroup>
12+
<SignAssembly>true</SignAssembly>
13+
</PropertyGroup>
14+
<PropertyGroup>
15+
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
18+
<DebugType>full</DebugType>
19+
<DefineConstants>DEBUG</DefineConstants>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
22+
<Optimize>true</Optimize>
23+
</PropertyGroup>
24+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
25+
<PropertyGroup>
26+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
27+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
28+
<SchemaVersion>2.0</SchemaVersion>
29+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
30+
<ProjectGuid>{20E5D5AE-8299-4522-AD34-FAE0DB331560}</ProjectGuid>
31+
<OutputType>Library</OutputType>
32+
<AppDesignerFolder>Properties</AppDesignerFolder>
33+
<RootNamespace>WakaTime</RootNamespace>
34+
<AssemblyName>WakaTime.Dev18</AssemblyName>
35+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
36+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
37+
<UseCodebase>true</UseCodebase>
38+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
39+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
40+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
41+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
42+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
43+
<StartAction>Program</StartAction>
44+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
45+
<StartArguments>/rootsuffix Exp</StartArguments>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
48+
<PlatformTarget>x64</PlatformTarget>
49+
<OutputPath>bin\x64\Debug\</OutputPath>
50+
<DefineConstants>TRACE;DEBUG</DefineConstants>
51+
<DebugType>full</DebugType>
52+
<DeployExtension>True</DeployExtension>
53+
</PropertyGroup>
54+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
55+
<PlatformTarget>x64</PlatformTarget>
56+
<OutputPath>bin\x64\Release\</OutputPath>
57+
<Optimize>true</Optimize>
58+
<DefineConstants>TRACE</DefineConstants>
59+
<DebugType>pdbonly</DebugType>
60+
<DebugSymbols>true</DebugSymbols>
61+
</PropertyGroup>
62+
<ItemGroup>
63+
<Compile Include="ExtensionUtils\GuidList2026.cs" />
64+
<Compile Include="ExtensionUtils\Logger.cs" />
65+
<Compile Include="ExtensionUtils\StatusbarControl.cs" />
66+
<Compile Include="ExtensionUtils\StatusbarInjector.cs" />
67+
<Compile Include="Forms\ApiKeyForm.cs">
68+
<SubType>Form</SubType>
69+
</Compile>
70+
<Compile Include="Forms\ApiKeyForm.Designer.cs">
71+
<DependentUpon>ApiKeyForm.cs</DependentUpon>
72+
</Compile>
73+
<Compile Include="Forms\SettingsForm.cs">
74+
<SubType>Form</SubType>
75+
</Compile>
76+
<Compile Include="Forms\SettingsForm.Designer.cs">
77+
<DependentUpon>SettingsForm.cs</DependentUpon>
78+
</Compile>
79+
<Compile Include="GlobalSuppressions.cs" />
80+
<Compile Include="Properties\AssemblyInfo.cs" />
81+
<Compile Include="WakaTimePackage.cs" />
82+
</ItemGroup>
83+
<ItemGroup>
84+
<Content Include="..\LICENSE">
85+
<Link>LICENSE</Link>
86+
<IncludeInVSIX>true</IncludeInVSIX>
87+
</Content>
88+
<None Include="Key.snk" />
89+
<None Include="source.extension.vsixmanifest">
90+
<SubType>Designer</SubType>
91+
</None>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<Reference Include="PresentationCore" />
95+
<Reference Include="PresentationFramework" />
96+
<Reference Include="System" />
97+
<Reference Include="System.Design" />
98+
<Reference Include="System.Drawing" />
99+
<Reference Include="System.IO.Compression.FileSystem" />
100+
<Reference Include="System.Web.Extensions" />
101+
<Reference Include="System.Windows.Forms" />
102+
<Reference Include="WindowsBase" />
103+
</ItemGroup>
104+
<ItemGroup>
105+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.32112.339" ExcludeAssets="runtime">
106+
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
107+
</PackageReference>
108+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.0.5234">
109+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
110+
<PrivateAssets>all</PrivateAssets>
111+
</PackageReference>
112+
<PackageReference Include="WakaTime.Shared.ExtensionUtils">
113+
<Version>4.2.2</Version>
114+
</PackageReference>
115+
</ItemGroup>
116+
<ItemGroup>
117+
<EmbeddedResource Include="Forms\APIKeyForm.resx">
118+
<DependentUpon>ApiKeyForm.cs</DependentUpon>
119+
</EmbeddedResource>
120+
<EmbeddedResource Include="Forms\SettingsForm.resx">
121+
<DependentUpon>SettingsForm.cs</DependentUpon>
122+
</EmbeddedResource>
123+
</ItemGroup>
124+
<ItemGroup>
125+
<Content Include="Assets\dashboard.png">
126+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
127+
<IncludeInVSIX>true</IncludeInVSIX>
128+
</Content>
129+
<Content Include="Assets\output-window.png" />
130+
<Content Include="Assets\wakatime-120.ico" />
131+
<Content Include="Assets\wakatime-120.png">
132+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
133+
<IncludeInVSIX>true</IncludeInVSIX>
134+
</Content>
135+
<Content Include="Assets\wakatime-16.png" />
136+
<VSCTCompile Include="WakaTime.vsct">
137+
<ResourceName>Menus.ctmenu</ResourceName>
138+
<SubType>Designer</SubType>
139+
</VSCTCompile>
140+
</ItemGroup>
141+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
142+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
143+
<PropertyGroup>
144+
<PreBuildEvent>
145+
</PreBuildEvent>
146+
</PropertyGroup>
147+
<PropertyGroup>
148+
<PostBuildEvent>
149+
</PostBuildEvent>
150+
</PropertyGroup>
151+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace WakaTime.ExtensionUtils
2+
{
3+
public static class GuidList2026
4+
{
5+
public const string GuidWakaTimePkgString = "E7851384-C3A7-4F70-B4EF-C9A2DCB9794C";
6+
}
7+
}

Dev18/ExtensionUtils/Logger.cs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
using Microsoft.VisualStudio.Shell;
2+
using Microsoft.VisualStudio.Shell.Interop;
3+
using System;
4+
using System.Globalization;
5+
using WakaTime.Shared.ExtensionUtils;
6+
7+
namespace WakaTime.ExtensionUtils
8+
{
9+
public class Logger : ILogger
10+
{
11+
private IVsOutputWindowPane _wakatimeOutputWindowPane;
12+
private IVsOutputWindowPane WakatimeOutputWindowPane =>
13+
_wakatimeOutputWindowPane ?? (_wakatimeOutputWindowPane = GetWakatimeOutputWindowPane());
14+
private readonly bool _isDebugEnabled;
15+
16+
public Logger(string configFilepath)
17+
{
18+
var configFile = new ConfigFile(configFilepath);
19+
20+
_isDebugEnabled = configFile.GetSettingAsBoolean("debug");
21+
}
22+
23+
private static IVsOutputWindowPane GetWakatimeOutputWindowPane()
24+
{
25+
if (!(Package.GetGlobalService(typeof(SVsOutputWindow)) is IVsOutputWindow outputWindow)) return null;
26+
27+
var outputPaneGuid = new Guid(GuidList.GuidWakatimeOutputPane.ToByteArray());
28+
29+
outputWindow.CreatePane(ref outputPaneGuid, "WakaTime", 1, 1);
30+
outputWindow.GetPane(ref outputPaneGuid, out var windowPane);
31+
32+
return windowPane;
33+
}
34+
35+
public void Debug(string message)
36+
{
37+
if (!_isDebugEnabled)
38+
return;
39+
40+
Log(LogLevel.Debug, message);
41+
}
42+
43+
public void Error(string message, Exception ex = null)
44+
{
45+
var exceptionMessage = $"{message}: {ex}";
46+
47+
Log(LogLevel.HandledException, exceptionMessage);
48+
}
49+
50+
public void Warning(string message)
51+
{
52+
Log(LogLevel.Warning, message);
53+
}
54+
55+
public void Info(string message)
56+
{
57+
Log(LogLevel.Info, message);
58+
}
59+
60+
private void Log(LogLevel level, string message)
61+
{
62+
var outputWindowPane = WakatimeOutputWindowPane;
63+
if (outputWindowPane == null) return;
64+
65+
var outputMessage =
66+
$"[WakaTime {Enum.GetName(level.GetType(), level)} {DateTime.Now.ToString("hh:mm:ss tt", CultureInfo.InvariantCulture)}] {message}{Environment.NewLine}";
67+
68+
outputWindowPane.OutputString(outputMessage);
69+
}
70+
}
71+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using Microsoft.VisualStudio.Shell;
2+
using System.Windows;
3+
using System.Windows.Controls;
4+
using System.Windows.Input;
5+
using System.Windows.Media;
6+
7+
namespace WakaTime.ExtensionUtils
8+
{
9+
internal class StatusbarControl : TextBlock
10+
{
11+
private const string Icon = "🕑";
12+
13+
private readonly Brush _normalBackground = new SolidColorBrush(Colors.Transparent);
14+
private readonly Brush _hoverBackground = new SolidColorBrush(Colors.White) { Opacity = 0.2 };
15+
16+
public StatusbarControl()
17+
{
18+
Text = Icon;
19+
Foreground = new SolidColorBrush(Colors.White);
20+
Background = _normalBackground;
21+
22+
VerticalAlignment = VerticalAlignment.Center;
23+
Margin = new Thickness(7, 0, 7, 0);
24+
Padding = new Thickness(7, 0, 7, 0);
25+
26+
MouseEnter += (s, e) =>
27+
{
28+
Cursor = Cursors.Hand;
29+
Background = _hoverBackground;
30+
};
31+
32+
MouseLeave += (s, e) =>
33+
{
34+
Cursor = Cursors.Arrow;
35+
Background = _normalBackground;
36+
};
37+
38+
MouseLeftButtonUp += (s, e) =>
39+
{
40+
// Open WakaTime in browser
41+
System.Diagnostics.Process.Start("https://wakatime.com/");
42+
};
43+
}
44+
45+
public void SetText(string text)
46+
{
47+
ThreadHelper.ThrowIfNotOnUIThread();
48+
Text = string.IsNullOrEmpty(text) ? Icon : $"{Icon} {text}";
49+
}
50+
51+
public void SetToolTip(string toolTip)
52+
{
53+
ThreadHelper.ThrowIfNotOnUIThread();
54+
ToolTip = toolTip;
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)