Skip to content

Commit 85bee04

Browse files
StevenTCramerclaude
andcommitted
Add Build.ps1 script and update CLAUDE.md documentation
- Created Build.ps1 to build entire solution without running - Added Build.ps1 to CLAUDE.md development commands - Build.ps1 validates build including static assets compilation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d3d73d8 commit 85bee04

File tree

4 files changed

+1472
-669
lines changed

4 files changed

+1472
-669
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Navigate to `TimeWarp.Architecture/` directory first:
2020
- `./Run.ps1` - Runs the Aspire orchestrator (Development environment)
2121
- `./RunDocker.ps1` - Run using Docker containers
2222
- `./RunTailwind.ps1` - Build Tailwind CSS for Web.Spa
23+
- `./Build.ps1` - Build entire solution without running (validates build including static assets)
2324

2425
**Testing:**
2526
- `./RunTests.ps1` - Runs all test suites using Fixie framework

TimeWarp.Architecture/Build.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build.ps1
2+
$Env:ASPNETCORE_ENVIRONMENT = "Development"
3+
4+
Push-Location $PSScriptRoot
5+
try {
6+
Write-Host "Building TimeWarp.Architecture solution..." -ForegroundColor Green
7+
8+
$projectPath = "Source/ContainerApps/Aspire/Aspire.AppHost/Aspire.AppHost.csproj"
9+
dotnet build $projectPath
10+
11+
Write-Host "Build complete!" -ForegroundColor Green
12+
}
13+
finally {
14+
Pop-Location
15+
}

TimeWarp.Architecture/Directory.Build.props

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@
5555
</PackageReference>
5656
</ItemGroup>
5757

58-
<!-- This is to add the CommitDate and CommitHash to your assemblyinfo -->
59-
58+
<!-- Add git commit date to assembly metadata -->
6059
<PropertyGroup>
6160
<GitCheckCommand>git rev-parse --is-inside-work-tree</GitCheckCommand>
62-
<GitLogCommand>git log -1 --format=%%ct</GitLogCommand>
61+
<GitLogCommand>git log -1 --format=%%cI</GitLogCommand>
6362
</PropertyGroup>
6463

6564
<Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent">
66-
<!-- Check if inside a Git repository and suppress output -->
65+
<!-- Check if inside a Git repository -->
6766
<Exec Command="$(GitCheckCommand)" IgnoreExitCode="true" StandardOutputImportance="Low" StandardErrorImportance="Low">
6867
<Output TaskParameter="ExitCode" PropertyName="GitInRepo" />
6968
</Exec>
@@ -74,27 +73,10 @@
7473
<GitRepoAvailable>false</GitRepoAvailable>
7574
</PropertyGroup>
7675

77-
<!-- Get the latest commit timestamp if inside a Git repository -->
76+
<!-- Get formatted commit date directly from git -->
7877
<Exec Command="$(GitLogCommand)" ConsoleToMSBuild="true" Condition="'$(GitRepoAvailable)' == 'true'" StandardOutputImportance="Low" StandardErrorImportance="Low">
79-
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/>
78+
<Output TaskParameter="ConsoleOutput" PropertyName="LastCommitDate"/>
8079
</Exec>
81-
<!-- Windows: Use the working DateTime.Parse().AddSeconds() approach -->
82-
<PropertyGroup Condition="'$(GitRepoAvailable)' == 'true' AND '$(OS)' == 'Windows_NT'">
83-
<!-- Define the Unix epoch start date -->
84-
<UnixEpochStart>1970-01-01T00:00:00Z</UnixEpochStart>
85-
<!-- Calculate the commit date in UTC from the timestamp -->
86-
<GitCommitDate>$([System.DateTime]::Parse($(UnixEpochStart)).AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssK'))</GitCommitDate>
87-
<!-- Assign the calculated date to LastCommitDate -->
88-
<LastCommitDate>$(GitCommitDate)</LastCommitDate>
89-
</PropertyGroup>
90-
91-
<!-- Linux/macOS: Use DateTime.Now as workaround (MSBuild limitation) -->
92-
<PropertyGroup Condition="'$(GitRepoAvailable)' == 'true' AND '$(OS)' != 'Windows_NT'">
93-
<!-- LIMITATION: DateTime.Parse().AddSeconds() fails on Linux with "Method not found"
94-
This is a known MSBuild cross-platform limitation. Using DateTime.Now as fallback.
95-
Git commit timestamp $(GitCommitTimestamp) is available but cannot be converted. -->
96-
<LastCommitDate>$([System.DateTime]::Now.ToString('yyyy-MM-ddTHH:mm:ssK'))</LastCommitDate>
97-
</PropertyGroup>
9880
<ItemGroup Condition="'$(GitRepoAvailable)' == 'true'">
9981
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
10082
<_Parameter1>CommitDate</_Parameter1>

0 commit comments

Comments
 (0)