Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog

## CURRENT
* META: Add AGENTS.md for guiding agents.
* META: Add basic PR validation.
## CURRENT
* META: Add AGENTS.md for guiding agents.
* META: Add basic PR validation.
* META: Adopt Nerdbank.GitVersioning with shared configuration and remove hard-coded package version.
* META: Document versioning flow, including the `dev` prerelease suffix and future automation follow-up.
* META: Document how shallow-clone agents should set `NBGV_GitEngine=Disabled` instead of unshallowing during builds.

## v0.1.3
* BUG: Fixed an issue where construction failures in `TrayIcon` crashed the host HWND.
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
</ItemGroup>
</Project>
224 changes: 116 additions & 108 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,116 @@
# Systray Doom

## Download

```pwsh
# 1. Clone the repo
git clone https://github.com/citelao/systray-doom

# 2. Put DOOM1.WAD in the systray_doom/ directory (you can find the shareware free & legal online)
# cp somethingsomething
```

## Usage

For usage of the systray library, see [the Systray README](./Systray/README.md).

> dotnet add package citelao.SystrayIcon

## Dev

```pwsh
# Build the Rust bindings
cd rust_bindings/
cargo build

# Build & run the Dotnet!
cd ..
dotnet run --project .\systray_doom\systray_doom.csproj
```

### Validating AOT compatibility

The Systray library is marked AOT-compatible, which *will* generate warnings for any issues in the library directly. However, that doesn't check its dependencies. To validate end-to-end:

```pwsh
# Publish all the things! This verifies AOT-compatibility
# https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
dotnet publish -c Release
```

### Publishing versions

Prerequisites (see above):

1. Ensure it builds!
2. Validate AOT compatibility

Then:

```pwsh

# Get an API key
# (for initial push, use `*` glob pattern)
# https://www.nuget.org/account/apikeys
# https://int.nugettest.org/account/apikeys
$apiKey = # paste from the website

# Publish to main
git checkout main
git merge dev

# Bump the version
# In systray.csproj, bump `<Version>`.

# Update the CHANGELOG
# ...

# Create the nupkg
# https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli
dotnet build -c release
# => Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg

ls Systray\bin\Release\*.nupkg

# Push to Nuget
dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.1.nupkg --api-key $apiKey --source https://api.nuget.org/v3/index.json
# Dummy Nuget:
# dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg --api-key $apiKey --source https://int.nugettest.org
```

## TODO

### Blockers

* [x] Split off systray code into a library
* [x] Support AnyCPU target
* [x] Support `<DisableRuntimeMarshalling>True</DisableRuntimeMarshalling>`
* [x] ^ Fix `WindowSubclassHandler` to support non-marshalled delegates.
* [x] License (ensure we cite WinForms)
* [x] Add README to package
* [x] Publish to NuGet
* [x] Add unit tests
* [x] Cleaner public types

### Nice-to-have

* [x] Reorganize internal types (`NoReleaseHwnd`, `NoReleaseSafeHandle`, etc.)
* [ ] Upgrade to a newer commit of Doomgeneric (specifically, one after the [sound commit](https://github.com/ozkl/doomgeneric/commit/d0946b46cf617467f014a25e264fd952698a13f9))
* [x] Automatically build the Rust bindings before building & launching the C#.
* [x] Deploy the Rust DLL alongside the C# so that you can run `dotnet run` anywhere.
* [ ] Better name in Taskbar personalization menu
* [x] Better logging

### TODO Features

* [ ] Double-click to show full window
* [x] Right-click menu
* [ ] Click to play/pause(?) (invisible input window to play?)
# Systray Doom

## Download

```pwsh
# 1. Clone the repo
git clone https://github.com/citelao/systray-doom

# 2. Put DOOM1.WAD in the systray_doom/ directory (you can find the shareware free & legal online)
# cp somethingsomething
```

## Usage

For usage of the systray library, see [the Systray README](./Systray/README.md).

> dotnet add package citelao.SystrayIcon

## Dev

```pwsh
# Build the Rust bindings
cd rust_bindings/
cargo build

# Build & run the Dotnet!
cd ..
dotnet run --project .\systray_doom\systray_doom.csproj
```

### Validating AOT compatibility

The Systray library is marked AOT-compatible, which *will* generate warnings for any issues in the library directly. However, that doesn't check its dependencies. To validate end-to-end:

```pwsh
# Publish all the things! This verifies AOT-compatibility
# https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
dotnet publish -c Release
```

### Publishing versions

Prerequisites (see above):

1. Ensure it builds!
2. Validate AOT compatibility

Then:

```pwsh

# Get an API key
# (for initial push, use `*` glob pattern)
# https://www.nuget.org/account/apikeys
# https://int.nugettest.org/account/apikeys
$apiKey = # paste from the website

# Publish to main
git checkout main
git merge dev

# Confirm the base version
# Update version.json's `"version"` field if you need to change the major/minor/patch.
# Nerdbank.GitVersioning automatically calculates the 4th component based on git height.

# Update the CHANGELOG
# ...

# Create the nupkg
# https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli
dotnet build -c release
# => Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg

ls Systray\bin\Release\*.nupkg

# Push to Nuget
dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.1.nupkg --api-key $apiKey --source https://api.nuget.org/v3/index.json
# Dummy Nuget:
# dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg --api-key $apiKey --source https://int.nugettest.org
```

### Versioning notes

* Nerdbank.GitVersioning provides the package and assembly versions from `version.json`. The `version` property controls the first three digits (major/minor/patch). The build height becomes the fourth component automatically so you do not need to edit it manually.
* Non-`main` branches (e.g. `dev`) publish prerelease builds that include a `-dev` suffix before the commit hash for clarity.
* Nerdbank.GitVersioning can automate release version bumps via the [`nbgv prepare-release`](https://dotnet.github.io/Nerdbank.GitVersioning/docs/nbgv-cli.html#prepare-release) command. TODO: evaluate wiring that into our release flow so merges to `main` automatically advance the base version.
* GitHub Copilot and other agents that work from shallow clones should set `NBGV_GitEngine=Disabled` in their environment so Nerdbank.GitVersioning skips walking commit history. This avoids build failures at the cost of omitting commit metadata from generated version information. See the [shallow-cloning agents guide](https://dotnet.github.io/Nerdbank.GitVersioning/docs/shallow-cloning-agents.html) for details.

## TODO

### Blockers

* [x] Split off systray code into a library
* [x] Support AnyCPU target
* [x] Support `<DisableRuntimeMarshalling>True</DisableRuntimeMarshalling>`
* [x] ^ Fix `WindowSubclassHandler` to support non-marshalled delegates.
* [x] License (ensure we cite WinForms)
* [x] Add README to package
* [x] Publish to NuGet
* [x] Add unit tests
* [x] Cleaner public types

### Nice-to-have

* [x] Reorganize internal types (`NoReleaseHwnd`, `NoReleaseSafeHandle`, etc.)
* [ ] Upgrade to a newer commit of Doomgeneric (specifically, one after the [sound commit](https://github.com/ozkl/doomgeneric/commit/d0946b46cf617467f014a25e264fd952698a13f9))
* [x] Automatically build the Rust bindings before building & launching the C#.
* [x] Deploy the Rust DLL alongside the C# so that you can run `dotnet run` anywhere.
* [ ] Better name in Taskbar personalization menu
* [x] Better logging

### TODO Features

* [ ] Double-click to show full window
* [x] Right-click menu
* [ ] Click to play/pause(?) (invisible input window to play?)
3 changes: 1 addition & 2 deletions systray/systray.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
https://github.com/dotMorten/WinUIEx/blob/a34db73cdd11bd1a9cda739ab17bae00c584df8d/src/WinUIEx/WinUIEx.csproj
-->
<PropertyGroup>
<PackageId>citelao.SystrayIcon</PackageId>
<Version>0.1.3.0</Version>
<PackageId>citelao.SystrayIcon</PackageId>
<Authors>Ben Stolovitz (citelao)</Authors>

<IsAotCompatible>true</IsAotCompatible>
Expand Down
14 changes: 14 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.1.3",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/tags/v\\d+(?:\\.\\d+)?$"
Comment on lines +4 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Correct tag regex to match three-part semver releases

The publicReleaseRefSpec list is intended to mark tagged builds as public releases, but the regex ^refs/tags/v\d+(?:\.\d+)?$ only matches tags like v1 or v1.2. Tags of the form v0.1.3—which the repo already uses for packages—will not match and therefore produce prerelease versions with the dev suffix even when building from a release tag. This breaks the stated versioning flow because tagged releases will still be treated as prerelease packages. The pattern should allow two dots (e.g. (\.\d+){2}) so that v<major>.<minor>.<patch> tags are considered public.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex, let's remove tags from the publicReleaseRefSpec for now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Updated publicReleaseRefSpec to exclude tag patterns so only main-branch builds count as public releases for now. version.jsonL4-L6
  • Documented the temporary removal in the changelog under the CURRENT section. CHANGELOG.mdL3-L9

Testing

  • ⚠️ No automated tests were run (not requested).

View task →

],
"gitCommitIdPrefix": "dev",
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}