Skip to content

Commit c6fa582

Browse files
committed
build: upgrade to .NET 10
1 parent fc3f1f4 commit c6fa582

13 files changed

Lines changed: 460 additions & 234 deletions

File tree

.github/workflows/build.yml

Lines changed: 168 additions & 129 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
1-
desktop.ini
2-
Thumbs.db
1+
TouchMax 12noon website.pdf
32

4-
**/.vs/
5-
**/Win32/
6-
**/x64/
7-
**/x86/
8-
**/amd64/
9-
**/ipch/
10-
**/Debug/
11-
**/Debug Console/
12-
**/Release/
13-
**/Release Console/
14-
**/obj/
15-
**/bin/
16-
**/AppPackages/
17-
**/TestResults/
18-
**/Generated Files/
19-
20-
#
21-
# Added by SourceTree
22-
#
23-
test/
24-
Directory.Build.props
25-
Properties/launchSettings.json
3+
Tests/*
4+
!Tests/
5+
!Tests/*.ps1

Directory.Build.props

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<Product>TouchMax</Product>
5+
<Description>TouchMax changes the Creation-Time and/or Modified-Time of any files or folders. It can use an absolute time or one relative to the file's creation time, file's modified time, or current time.</Description>
6+
7+
<Authors>Stefan K.S. Tucker</Authors>
8+
<Company>12noon LLC</Company>
9+
<Year>$([System.DateTime]::UtcNow.Year)</Year>
10+
<Copyright>© 2006-$(Year) 12noon LLC</Copyright>
11+
</PropertyGroup>
12+
13+
<PropertyGroup>
14+
<VersionPrefix>3.3.0</VersionPrefix>
15+
<VersionSuffix Condition="'$(Configuration)' == 'Debug'">debug</VersionSuffix>
16+
<!-- `Version` defaults to `VersionPrefix`+`VersionSuffix` -->
17+
18+
<!-- Windows file properties A.B.C.0 -->
19+
<FileVersion>$(VersionPrefix).0</FileVersion>
20+
21+
<!-- Stable API identity version, usually updated only on breaking changes -->
22+
<!-- Only set in individual projects. -->
23+
<AssemblyVersion />
24+
25+
<!-- Used for human-readable version, About, Explorer, crash logs, marketing|build metadata -->
26+
<!-- Defaults to `Version`+githash -->
27+
<InformationalVersion />
28+
<IncludeSourceRevisionInInformationalVersion>true</IncludeSourceRevisionInInformationalVersion>
29+
30+
<!-- Used for packaging (.wapproj) -->
31+
<AppxBundleVersion>$(Version)</AppxBundleVersion>
32+
33+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
34+
</PropertyGroup>
35+
36+
<PropertyGroup>
37+
<ArtifactsPath>C:\VSIntermediate\TouchMax\artifacts\</ArtifactsPath>
38+
<BaseIntermediateOutputPath>$(ArtifactsPath)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
39+
</PropertyGroup>
40+
</Project>
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
Set-PSDebug -Strict
66

7-
87
#
98
# Perform a single test.
109
# If a passed "expected" date/time object is $Null, there should be no change.
@@ -40,14 +39,12 @@ function TestRun(
4039
#
4140
# Perform the TouchMax operation
4241
#
43-
# .\publish\TouchMax.exe
44-
# .\bin\Release\net6.0\TouchMax.exe
45-
# .\bin\Debug\net6.0\TouchMax.exe
46-
if (-not(Test-Path '.\publish\TouchMax.exe'))
42+
$exists = [bool](Get-Command TouchMax.exe -ErrorAction SilentlyContinue)
43+
if (!$exists)
4744
{
4845
throw 'Executable does not exist.'
4946
}
50-
.\publish\TouchMax.exe $argsOperation.Split() $fn
47+
TouchMax.exe $argsOperation.Split() $fn
5148

5249
#
5350
# Test the expected timestamps
@@ -152,5 +149,5 @@ TestRun "Set Modified to Now -4 years, +3 days, -26 minutes" $dtCreation $dtModi
152149

153150

154151
#TestRun $dtCreation $dtModified "/setfiles /setmodified /Y= /M= /D= /h= /m=" $dtExpectedCreation $dtExpectedModified
155-
# .\bin\Debug\net5.0\TouchMax.exe /setfiles /setcreation ("/Y={0}" -f $dtExpectedCreation.Year) ("/M={0}" -f $dtExpectedCreation.Month) ("/D={0}" -f $dtExpectedCreation.Day) ("/h={0}" -f $dtExpectedCreation.Hour) ("/m={0}" -f $dtExpectedCreation.Minute) $fn
152+
# TouchMax.exe /setfiles /setcreation ("/Y={0}" -f $dtExpectedCreation.Year) ("/M={0}" -f $dtExpectedCreation.Month) ("/D={0}" -f $dtExpectedCreation.Day) ("/h={0}" -f $dtExpectedCreation.Hour) ("/m={0}" -f $dtExpectedCreation.Minute) $fn
156153
#"/setfiles /setmodified /Y=2006 /M=4 /D=30 /h=15 /m=9"

TouchMax.csproj

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

TouchMax.sln

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

TouchMax.slnx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Solution>
2+
<Configurations>
3+
<Platform Name="x64" />
4+
</Configurations>
5+
<Folder Name="/Solution Items/">
6+
<File Path=".github/workflows/build.yml" />
7+
<File Path="devtools/BuildMsStore.cmd" />
8+
<File Path="Directory.Build.props" />
9+
<File Path="Tests/TestTouchMax.ps1" />
10+
</Folder>
11+
<Project Path="TouchMax/TouchMax.csproj">
12+
<Platform Project="x64" />
13+
</Project>
14+
</Solution>

Program.cs renamed to TouchMax/Program.cs

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
using System;
2+
using System.CommandLine;
3+
using System.CommandLine.Help;
4+
using System.CommandLine.Invocation;
25
using System.IO;
36
using System.Linq;
47

58
namespace TouchMax;
69

7-
/*
8-
* Usage:
9-
* TouchMax +/-HH:MM <file specification>
10-
*
11-
* Pass a file path (with optional wildcards) and the offset to use to
12-
* change the file's last-modified time.
13-
*/
14-
class Program
10+
internal class CustomHelpAction(HelpAction _defaultAction) : SynchronousCommandLineAction
11+
{
12+
public override int Invoke(ParseResult parseResult)
13+
{
14+
parseResult.InvocationConfiguration.Output.Write("header");
15+
16+
int result = _defaultAction.Invoke(parseResult);
17+
18+
//parseResult.InvocationConfiguration.Output.WriteLine("FOOTER");
19+
20+
return result;
21+
22+
}
23+
}
24+
25+
/// <summary>
26+
/// Pass a file path (with optional wildcards) and the offset to use to
27+
/// change the file's last-modified time.
28+
/// </summary>
29+
/// <example>
30+
/// TouchMax.exe +/-HH:MM <file specification>
31+
/// </example>
32+
public class Program
1533
{
1634
private bool _bTest = false;
1735

@@ -356,7 +374,7 @@ private void ParseArguments(string[] args)
356374
{
357375
try
358376
{
359-
if (a.StartsWith("-") || a.StartsWith("/"))
377+
if (a.StartsWith('-') || a.StartsWith('/'))
360378
{
361379
string key = a[1..].ToLower();
362380
if (key.StartsWith("test"))

Properties/PublishProfiles/FolderProfile.pubxml renamed to TouchMax/Properties/PublishProfiles/FolderProfile.pubxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
88
<Platform>x64</Platform>
99
<PublishDir>C:\VSIntermediate\TouchMax\publish\</PublishDir>
1010
<PublishProtocol>FileSystem</PublishProtocol>
11-
<TargetFramework>net9.0-windows</TargetFramework>
11+
<TargetFramework>net10.0-windows</TargetFramework>
1212
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
1313
<SelfContained>true</SelfContained>
1414
<PublishSingleFile>true</PublishSingleFile>

0 commit comments

Comments
 (0)