Merge pull request #24 from poli0981/claude/serene-wright-eae288

build: assembly metadata + Velopack --packAuthors (v-next Đợt 1)
This commit is contained in:
poli0981 authored and GitHub committed 2026-06-19 14:24:09 +07:00
commit 3713c8189a
3 files changed
+57 -1

No files matched your search

+22
View File
@@ -23,4 +23,26 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
<!--
Package / assembly metadata, inherited by every project. Surfaced in Settings -> About
and the Report-Bug template (via Assembly.GetName().Version), in the file properties, and
in the Velopack installer (scripts/pack.ps1 passes Authors via the packAuthors flag).
Version here is only the dev-build default; scripts/pack.ps1 overrides it at publish time
with the Version/FileVersion/InformationalVersion properties off the git tag. AssemblyVersion is
intentionally NOT pinned, so it follows Version and the in-app "App version" stays accurate
(binding-redirect churn is a non-issue for a self-contained app, not a shared library).
-->
<PropertyGroup>
<Product>CommandForge</Product>
<Authors>poli0981</Authors>
<Company>poli0981</Company>
<Copyright>Copyright © 2026 poli0981</Copyright>
<Description>Run complex Windows system commands through a visual, categorized interface.</Description>
<RepositoryUrl>https://github.com/poli0981/CommandForge</RepositoryUrl>
<PackageProjectUrl>https://github.com/poli0981/CommandForge</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<Version>1.0.0</Version>
</PropertyGroup>
</Project>
+3 -1
View File
@@ -37,7 +37,7 @@ Write-Host "Publishing CommandForge $Version ($Runtime, $Configuration)..." -For
dotnet publish $wpfProject `
-c $Configuration -r $Runtime --self-contained true `
-p:PublishSingleFile=false `
-p:Version=$Version -p:InformationalVersion=$Version `
-p:Version=$Version -p:FileVersion=$Version -p:InformationalVersion=$Version `
-o $publishDir
# vpk is the Velopack CLI: dotnet tool install -g vpk
@@ -48,6 +48,8 @@ if (-not (Get-Command vpk -ErrorAction SilentlyContinue)) {
Write-Host "Packing with Velopack..." -ForegroundColor Cyan
vpk pack `
--packId CommandForge `
--packTitle CommandForge `
--packAuthors poli0981 `
--packVersion $Version `
--packDir $publishDir `
--mainExe CommandForge.Wpf.exe
@@ -0,0 +1,32 @@
using System.Reflection;
using CommandForge.Domain;
namespace CommandForge.Tests;
/// <summary>
/// Verifies the package/assembly metadata declared in Directory.Build.props is stamped into
/// the built assemblies. This metadata is surfaced in Settings -> About, the Report-Bug
/// template, the file properties, and the Velopack installer (--packAuthors).
/// </summary>
public sealed class AssemblyMetadataTests
{
// Domain is the lowest layer and inherits the same Directory.Build.props metadata as the rest.
private static readonly Assembly Target = typeof(CommandDefinition).Assembly;
[Fact]
public void Assembly_HasExpectedCompany()
=> Assert.Equal("poli0981", Target.GetCustomAttribute<AssemblyCompanyAttribute>()?.Company);
[Fact]
public void Assembly_HasExpectedProduct()
=> Assert.Equal("CommandForge", Target.GetCustomAttribute<AssemblyProductAttribute>()?.Product);
[Fact]
public void Assembly_HasCopyrightWithOwner()
{
var copyright = Target.GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright;
Assert.NotNull(copyright);
Assert.Contains("poli0981", copyright, StringComparison.Ordinal);
}
}