Skip to content

Commit e7683ac

Browse files
gfraiteurclaude
andcommitted
Make generate-scripts command imply -NoCache and cleanup Docker components
The generate-scripts command now automatically bypasses the build cache, ensuring that script generation always uses the latest build. Also adds Azure CLI to PATH and removes redundant comments from Docker component files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 3245aaa commit e7683ac

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

Build.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ if ($env:RUNNING_IN_DOCKER)
3939

4040
if (-not $Interactive -or $BuildArgs)
4141
{
42+
# The generate-scripts command implies -NoCache
43+
if ($BuildArgs -contains 'generate-scripts')
44+
{
45+
$NoCache = $true
46+
}
47+
4248
# Change the working directory so we can use a global.json that is specific to eng.
4349
$previousLocation = Get-Location
4450

src/PostSharp.Engineering.BuildTools/Docker/AzureCliComponent.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public override void WriteDockerfile( TextWriter writer )
2020
$process = Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I AzureCLI.msi /quiet'; `
2121
if ($process.ExitCode -ne 0) { exit $process.ExitCode }; `
2222
Remove-Item AzureCLI.msi
23+
24+
ENV PATH="C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;${PATH}"
2325
""" );
2426
}
2527
}

src/PostSharp.Engineering.BuildTools/Docker/GitHubCliComponent.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public override void WriteDockerfile( TextWriter writer )
2121
if ($process.ExitCode -ne 0) { exit $process.ExitCode }; `
2222
Remove-Item gh.msi
2323
24-
# Add GitHub CLI to PATH using ENV directive (persists across shell switches)
2524
ENV PATH="C:\Program Files\GitHub CLI;${PATH}"
2625
""" );
2726
}

src/PostSharp.Engineering.BuildTools/Docker/NodeJsComponent.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ public override void WriteDockerfile( TextWriter writer )
3232

3333
writer.WriteLine(
3434
$$"""
35-
# Install Node.js {{version}} directly
3635
RUN Invoke-WebRequest -Uri "https://nodejs.org/dist/v{{version}}/node-v{{version}}-win-x64.zip" -OutFile node.zip; `
3736
Expand-Archive node.zip -DestinationPath C:\; `
3837
Rename-Item "C:\node-v{{version}}-win-x64" "C:\nodejs"; `
3938
Remove-Item node.zip
4039
41-
# Add Node.js to PATH using ENV directive (persists across shell switches)
4240
ENV PATH="C:\nodejs;${PATH}"
4341
""" );
4442
}

src/PostSharp.Engineering.BuildTools/Docker/PowershellComponent.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public override void WriteDockerfile( TextWriter writer )
1919
if ($process.ExitCode -ne 0) { exit $process.ExitCode }; `
2020
Remove-Item PowerShell.msi
2121
22-
# Add PowerShell 7 to PATH using ENV directive (persists across shell switches)
2322
ENV PATH="C:\Program Files\PowerShell\7;${PATH}"
2423
""" );
2524
}

src/PostSharp.Engineering.BuildTools/Resources/Build.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ if ($env:RUNNING_IN_DOCKER)
3939

4040
if (-not $Interactive -or $BuildArgs)
4141
{
42+
# The generate-scripts command implies -NoCache
43+
if ($BuildArgs -contains 'generate-scripts')
44+
{
45+
$NoCache = $true
46+
}
47+
4248
# Change the working directory so we can use a global.json that is specific to eng.
4349
$previousLocation = Get-Location
4450

0 commit comments

Comments
 (0)