Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
.PARAMETER SkipRestore
Skips restoring NuGet packages

.PARAMETER Clean
If set, removes the repository-level Output/ and Obj/ directories before building.
Useful to clear stale artifacts that can cause assembly version mismatches.

.PARAMETER SkipNative
Skips building native C++ components. Use this for faster iterations when making purely managed code changes.

Expand Down Expand Up @@ -134,6 +138,10 @@
.\build.ps1 -RunTests
Builds Debug x64 including test projects and runs all tests.

.EXAMPLE
.\build.ps1 -Clean
Removes Output/ and Obj/ first, then builds Debug x64.

.EXAMPLE
.\build.ps1 -Serial -Verbosity detailed
Builds Debug x64 serially with detailed logging.
Expand Down Expand Up @@ -163,6 +171,7 @@ param(
[string]$LogFile,
[int]$TailLines,
[switch]$SkipRestore,
[switch]$Clean,
[switch]$SkipNative,
[switch]$SkipNativeTests,
[switch]$SkipManagedTests,
Expand Down Expand Up @@ -391,6 +400,26 @@ try {
$fwTasksDropPath = Join-Path $PSScriptRoot "BuildTools/FwBuildTasks/$Configuration/FwBuildTasks.dll"

Invoke-WithFileLockRetry -Context "FieldWorks build" -IncludeOmniSharp -RepoRoot $PSScriptRoot -Action {
if ($Clean) {
if ($InstallerOnly) {
throw "-Clean cannot be used with -InstallerOnly because installer-only builds require existing Output\\<Configuration> artifacts."
}

Write-Host "Cleaning build artifacts (Output/, Obj/) ..." -ForegroundColor Cyan
$pathsToClean = @(
(Join-Path $PSScriptRoot "Output"),
(Join-Path $PSScriptRoot "Obj")
)

foreach ($path in $pathsToClean) {
if (Test-Path $path) {
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
}
}

Write-Host "Clean complete." -ForegroundColor Green
}

# Initialize Visual Studio Developer environment
Initialize-VsDevEnvironment
Test-CvtresCompatibility
Expand Down
Loading