Skip to content

Commit 5afc32d

Browse files
Remove Directory.Build.props and Directory.Build.targets files; add copyright headers to IconHelper files; delete unused PowerShell scripts for metadata and version management.
1 parent 2aa3dfe commit 5afc32d

11 files changed

Lines changed: 2343 additions & 785 deletions

Directory.Build.props

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

Directory.Build.targets

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

IconHelper/Arguments.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) ktsu.dev
2+
// All rights reserved.
3+
// Licensed under the MIT license.
4+
15
namespace ktsu.IconHelper;
26

37
using System.Collections.ObjectModel;

IconHelper/IconHelper.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) ktsu.dev
2+
// All rights reserved.
3+
// Licensed under the MIT license.
4+
15
namespace ktsu.IconHelper;
26

37
using System.Drawing;
@@ -29,7 +33,7 @@ private static void Run(Arguments args)
2933

3034
var color = ColorTranslator.FromHtml(args.Color);
3135
var files = Directory.GetFiles(args.InputPath, "*").ToCollection();
32-
foreach (string file in files)
36+
foreach (var file in files)
3337
{
3438
if (file.Contains(".new.png"))
3539
{
@@ -41,10 +45,10 @@ private static void Run(Arguments args)
4145
Console.WriteLine($"Processing {file}...");
4246
var image = Image.Load<Rgba32>(file);
4347

44-
int top = image.Height;
45-
int left = image.Width;
46-
int right = 0;
47-
int bottom = 0;
48+
var top = image.Height;
49+
var left = image.Width;
50+
var right = 0;
51+
var bottom = 0;
4852

4953
image.Mutate(x => x.BlackWhite());
5054

@@ -53,11 +57,11 @@ private static void Run(Arguments args)
5357

5458
image.ProcessPixelRows(accessor =>
5559
{
56-
for (int y = 0; y < accessor.Height; y++)
60+
for (var y = 0; y < accessor.Height; y++)
5761
{
5862
var pixelRow = accessor.GetRowSpan(y);
5963

60-
for (int x = 0; x < pixelRow.Length; x++)
64+
for (var x = 0; x < pixelRow.Length; x++)
6165
{
6266
ref var pixel = ref pixelRow[x];
6367
if (pixel.A != 0)
@@ -68,19 +72,19 @@ private static void Run(Arguments args)
6872
}
6973
});
7074

71-
bool isBlack = maxValue == 0;
75+
var isBlack = maxValue == 0;
7276
maxValue = isBlack ? (byte)255 : maxValue;
7377

7478
image.ProcessPixelRows(accessor =>
7579
{
76-
for (int y = 0; y < accessor.Height; y++)
80+
for (var y = 0; y < accessor.Height; y++)
7781
{
7882
var pixelRow = accessor.GetRowSpan(y);
7983

80-
for (int x = 0; x < pixelRow.Length; x++)
84+
for (var x = 0; x < pixelRow.Length; x++)
8185
{
8286
ref var pixel = ref pixelRow[x];
83-
byte newValue = (byte)(isBlack ? 255 : 255 - (maxValue - pixel.R));
87+
var newValue = (byte)(isBlack ? 255 : 255 - (maxValue - pixel.R));
8488
if (pixel.A != 0)
8589
{
8690
left = Math.Min(left, x);
@@ -100,14 +104,14 @@ private static void Run(Arguments args)
100104
}
101105
});
102106

103-
int minWidth = right - left;
104-
int minHeight = bottom - top;
105-
int newSize = Math.Max(minWidth, minHeight);
107+
var minWidth = right - left;
108+
var minHeight = bottom - top;
109+
var newSize = Math.Max(minWidth, minHeight);
106110
var center = new PointF(left + (minWidth / 2f), top + (minHeight / 2f));
107111

108112
// We intentionally only shrink the image and not grow it
109-
int finalSize = Math.Min(newSize, args.Size);
110-
int finalContentSize = finalSize - (args.Padding * 2);
113+
var finalSize = Math.Min(newSize, args.Size);
114+
var finalContentSize = finalSize - (args.Padding * 2);
111115
var paddingColor = Rgba32.ParseHex("00000000");
112116

113117
image.Mutate(x => x
@@ -122,7 +126,7 @@ private static void Run(Arguments args)
122126
.Resize(finalContentSize, finalContentSize)
123127
.Pad(finalSize, finalSize, paddingColor));
124128

125-
string outputFilePath = Path.Join(args.OutputPath, Path.GetFileName(file));
129+
var outputFilePath = Path.Join(args.OutputPath, Path.GetFileName(file));
126130

127131
image.SaveAsPng(outputFilePath, new()
128132
{

scripts/PSBuild.psd1

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
@{
2+
# Module information
3+
RootModule = 'PSBuild.psm1'
4+
ModuleVersion = '1.1.0'
5+
GUID = '15dd2bfc-0f11-4c8a-b98a-f2529558f423'
6+
Author = 'ktsu.dev'
7+
CompanyName = 'ktsu.dev'
8+
Copyright = '(c) 2023-2025 ktsu.dev. All rights reserved.'
9+
Description = 'A comprehensive PowerShell module for automating the build, test, package, and release process for .NET applications using Git-based versioning.'
10+
11+
# PowerShell version required
12+
PowerShellVersion = '5.1'
13+
14+
# Functions to export
15+
FunctionsToExport = @(
16+
# Core build and environment functions
17+
'Initialize-BuildEnvironment',
18+
'Get-BuildConfiguration',
19+
20+
# Version management functions
21+
'Get-GitTags',
22+
'Get-VersionType',
23+
'Get-VersionInfoFromGit',
24+
'New-Version',
25+
26+
# Version comparison and conversion functions
27+
'ConvertTo-FourComponentVersion',
28+
'Get-VersionNotes',
29+
30+
# Metadata and documentation functions
31+
'New-Changelog',
32+
'Update-ProjectMetadata',
33+
'New-License',
34+
35+
# .NET SDK operations
36+
'Invoke-DotNetRestore',
37+
'Invoke-DotNetBuild',
38+
'Invoke-DotNetTest',
39+
'Invoke-DotNetPack',
40+
'Invoke-DotNetPublish',
41+
42+
# Release and publishing functions
43+
'Invoke-NuGetPublish',
44+
'New-GitHubRelease',
45+
46+
# Utility functions
47+
'Assert-LastExitCode',
48+
'Write-StepHeader',
49+
'Test-AnyFiles',
50+
'Get-GitLineEnding',
51+
'Set-GitIdentity',
52+
'Write-InformationStream',
53+
'Invoke-ExpressionWithLogging',
54+
55+
# High-level workflow functions
56+
'Invoke-BuildWorkflow',
57+
'Invoke-ReleaseWorkflow',
58+
'Invoke-CIPipeline'
59+
)
60+
61+
# Variables to export
62+
VariablesToExport = @()
63+
64+
# Aliases to export
65+
AliasesToExport = @()
66+
67+
# Tags for PowerShell Gallery
68+
PrivateData = @{
69+
PSData = @{
70+
Tags = @(
71+
'build',
72+
'dotnet',
73+
'ci',
74+
'cd',
75+
'nuget',
76+
'github',
77+
'versioning',
78+
'release',
79+
'automation'
80+
)
81+
LicenseUri = 'https://github.com/ktsu-dev/PSBuild/blob/main/LICENSE.md'
82+
ProjectUri = 'https://github.com/ktsu-dev/PSBuild'
83+
ReleaseNotes = @'
84+
v1.1.0:
85+
- Improved object model using PSCustomObjects instead of hashtables
86+
- Enhanced git status detection and commit handling
87+
- Fixed logging and variable capture issues
88+
- Added comprehensive help comments to all functions
89+
- Added utility functions to the exported functions list
90+
91+
v1.0.0:
92+
- Initial release of PSBuild module featuring:
93+
- Semantic versioning based on git history
94+
- Automatic version calculation from commit analysis
95+
- Metadata file generation and management
96+
- Comprehensive build, test, and package pipeline
97+
- NuGet package creation and publishing
98+
- GitHub release creation with assets
99+
- Proper line ending handling based on git config
100+
'@
101+
}
102+
}
103+
}

0 commit comments

Comments
 (0)