Skip to content
Draft
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
26 changes: 17 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
If set, includes optional utility applications (e.g. MigrateSqlDbs, LCMBrowser, UnicodeCharEditor) in the build.
Default is false unless -BuildInstaller is specified, which enables it automatically.

.PARAMETER Project
Path to the MSBuild project or solution to build. Default is FieldWorks.proj in the repo root.

.PARAMETER Target
Specifies a *legacy* MSBuild target (from the .targets files in .\Build). Overrides -Project.

.PARAMETER Verbosity
Specifies the amount of information to display in the build log.
Values: q[uiet], m[inimal], n[ormal], d[etailed], diag[nostic].
Expand Down Expand Up @@ -108,9 +114,6 @@
Path to the local liblcm repository. Defaults to ../liblcm relative to the FieldWorks repo root.
Only used when -UseLocalLcm is specified.

.PARAMETER LogFile
Path to a file where the build output should be logged.

.PARAMETER StartedBy
Optional actor label written to the worktree lock metadata (for example: user or agent).
Defaults to the FW_BUILD_STARTED_BY environment variable when set, otherwise 'unknown'.
Expand All @@ -119,11 +122,6 @@
Internal switch used when build.ps1 is invoked from test.ps1 while the parent test workflow
already owns the same-worktree lock. Skips acquiring/releasing that lock again.

.PARAMETER TailLines
If specified, only displays the last N lines of output after the build completes.
Useful for CI/agent scenarios where you want to see recent output without piping.
The full output is still written to LogFile if specified.

.PARAMETER SkipDependencyCheck
If set, skips the dependency preflight check that verifies that required SDKs and tools are installed.

Expand Down Expand Up @@ -165,6 +163,7 @@ param(
[string]$TestFilter,
[switch]$BuildAdditionalApps,
[string]$Project = "FieldWorks.proj",
[string]$Target,
[string]$Verbosity = "minimal",
[ValidateSet('true', 'false', 'auto')]
[string]$NodeReuse = 'auto',
Expand Down Expand Up @@ -195,6 +194,7 @@ param(
)

$ErrorActionPreference = "Stop"
$LegacyAndInstallerProject = "Build\InstallerBuild.proj"

$runningOnWindows = [System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Windows)
if (-not $runningOnWindows) {
Expand Down Expand Up @@ -515,6 +515,9 @@ try {
# Stop conflicting processes before the build
Stop-ConflictingProcesses @cleanupArgs

if ($Target) {
$Project = $LegacyAndInstallerProject
}
$projectPath = $Project
$rootedProjectPath = Join-Path $PSScriptRoot $Project
if (-not (Test-Path $projectPath) -and (Test-Path $rootedProjectPath)) {
Expand Down Expand Up @@ -565,6 +568,11 @@ try {
$finalMsBuildArgs = @()
$nodeReuseDecision = Resolve-NodeReuse -Mode $NodeReuse

# Legacy Target
if ($Target) {
$finalMsBuildArgs += "/t:$Target"
}

# Parallelism
if (-not $Serial) {
$finalMsBuildArgs += "/m"
Expand Down Expand Up @@ -799,7 +807,7 @@ try {
}

Invoke-MSBuild `
-Arguments (@('Build/InstallerBuild.proj', "/t:Build$BaseOrPatch", '/p:config=release', "/p:InstallerToolset=$InstallerToolset", $installerCleanArg) + `
-Arguments (@($LegacyAndInstallerProject, "/t:Build$BaseOrPatch", '/p:config=release', "/p:InstallerToolset=$InstallerToolset", $installerCleanArg) + `
$InstallerMsBuildArgs) `
-Description "$BaseOrPatch Build" `
-LogPath $LogFile `
Expand Down
Loading