Skip to content

Commit 349ace3

Browse files
Add SIL.Machine as a local library option (#807)
Support packing and versioning SIL.Machine alongside the existing liblcm, libpalaso, and chorus libraries. Uses SILMACHINE_PATH env var and -Machine/-MachinePath parameters. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ec75d33 commit 349ace3

2 files changed

Lines changed: 29 additions & 9 deletions

File tree

Build/Manage-LocalLibraries.ps1

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Two modes of operation:
77
88
Pack mode (one or more source paths provided):
9-
Packs local checkouts of liblcm, libpalaso, and/or chorus into the
9+
Packs local checkouts of liblcm, libpalaso, chorus, and/or machine into the
1010
local NuGet feed using each library's own version. Detects the version
1111
from produced packages, updates SilVersions.props to match, copies
1212
PDBs, and clears stale cached packages.
@@ -44,9 +44,16 @@
4444
Path to a local chorus checkout. Overrides LIBCHORUS_PATH env var.
4545
Only used when -Chorus is specified.
4646
47+
.PARAMETER Machine
48+
Switch: include SIL.Machine in the pack operation.
49+
50+
.PARAMETER MachinePath
51+
Path to a local machine checkout. Overrides SILMACHINE_PATH env var.
52+
Only used when -Machine is specified.
53+
4754
.PARAMETER Library
4855
Which library to set a version for (SetVersion mode only):
49-
liblcm, libpalaso, or chorus.
56+
liblcm, libpalaso, chorus, or machine.
5057
5158
.PARAMETER Version
5259
Sets the version in SilVersions.props (SetVersion mode). Use to revert
@@ -75,7 +82,10 @@ param(
7582
[switch]$Chorus,
7683
[string]$ChorusPath,
7784

78-
[ValidateSet('liblcm', 'libpalaso', 'chorus')]
85+
[switch]$Machine,
86+
[string]$MachinePath,
87+
88+
[ValidateSet('liblcm', 'libpalaso', 'chorus', 'machine')]
7989
[string]$Library,
8090

8191
[string]$Version
@@ -110,10 +120,16 @@ $LibraryConfig = @{
110120
CachePrefixes = @('sil.chorus')
111121
EnvVar = 'LIBCHORUS_PATH'
112122
}
123+
machine = @{
124+
VersionProperty = 'SilMachineVersion'
125+
PdbRelativeDir = 'bin/Debug/netstandard2.0'
126+
CachePrefixes = @('sil.machine')
127+
EnvVar = 'SILMACHINE_PATH'
128+
}
113129
}
114130

115131
# Pack order: libpalaso first (other libraries may depend on it)
116-
$PackOrder = @('libpalaso', 'liblcm', 'chorus')
132+
$PackOrder = @('libpalaso', 'liblcm', 'chorus', 'machine')
117133

118134
# ---------------------------------------------------------------------------
119135
# Read SilVersions.props
@@ -301,6 +317,7 @@ $switchMap = @{
301317
libpalaso = @{ Enabled = [bool]$Palaso; ExplicitPath = $PalasoPath }
302318
liblcm = @{ Enabled = [bool]$Lcm; ExplicitPath = $LcmPath }
303319
chorus = @{ Enabled = [bool]$Chorus; ExplicitPath = $ChorusPath }
320+
machine = @{ Enabled = [bool]$Machine; ExplicitPath = $MachinePath }
304321
}
305322

306323
# Resolve source paths: explicit path > env var (only when switch is set)
@@ -387,5 +404,5 @@ elseif ($Library -and $Version) {
387404
Write-Host "Run .\build.ps1 to restore and build with the new version." -ForegroundColor Cyan
388405
}
389406
else {
390-
throw "Nothing to do. Use -Palaso/-Lcm/-Chorus switches to pack, or -Library and -Version to set a version.`nExamples:`n .\Build\Manage-LocalLibraries.ps1 -Palaso -PalasoPath C:\Repos\libpalaso`n .\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus`n .\Build\Manage-LocalLibraries.ps1 -Library libpalaso -Version 17.0.0"
407+
throw "Nothing to do. Use -Palaso/-Lcm/-Chorus/-Machine switches to pack, or -Library and -Version to set a version.`nExamples:`n .\Build\Manage-LocalLibraries.ps1 -Palaso -PalasoPath C:\Repos\libpalaso`n .\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus`n .\Build\Manage-LocalLibraries.ps1 -Machine -MachinePath C:\Repos\machine`n .\Build\Manage-LocalLibraries.ps1 -Library libpalaso -Version 17.0.0"
391408
}

Docs/architecture/local-library-debugging.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Local Library Debugging
22

3-
This document describes how to debug locally-modified versions of **liblcm**, **libpalaso**, or **chorus** in FieldWorks using a local NuGet feed.
3+
This document describes how to debug locally-modified versions of **liblcm**, **libpalaso**, **chorus**, or **machine** (SIL.Machine) in FieldWorks using a local NuGet feed.
44

55
## Overview
66

@@ -44,6 +44,7 @@ The script automatically registers this folder as a NuGet source in your user-le
4444
git clone https://github.com/sillsdev/liblcm.git
4545
git clone https://github.com/sillsdev/libpalaso.git
4646
git clone https://github.com/sillsdev/chorus.git
47+
git clone https://github.com/sillsdev/machine.git
4748
```
4849

4950
## Pack a local library
@@ -59,9 +60,10 @@ git clone https://github.com/sillsdev/chorus.git
5960
Or set environment variables so you can omit the paths:
6061

6162
```powershell
62-
$env:LIBPALASO_PATH = "C:\Repos\libpalaso"
63-
$env:LIBLCM_PATH = "C:\Repos\liblcm"
64-
$env:LIBCHORUS_PATH = "C:\Repos\chorus"
63+
$env:LIBPALASO_PATH = "C:\Repos\libpalaso"
64+
$env:LIBLCM_PATH = "C:\Repos\liblcm"
65+
$env:LIBCHORUS_PATH = "C:\Repos\chorus"
66+
$env:SILMACHINE_PATH = "C:\Repos\machine"
6567
6668
# Switches still required — env vars only provide the path
6769
.\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus
@@ -139,6 +141,7 @@ dotnet nuget remove source local
139141
| liblcm | `-Lcm` | `-LcmPath` | `SilLcmVersion` | `LIBLCM_PATH` |
140142
| libpalaso | `-Palaso` | `-PalasoPath` | `SilLibPalasoVersion` | `LIBPALASO_PATH` |
141143
| chorus | `-Chorus` | `-ChorusPath` | `SilChorusVersion` | `LIBCHORUS_PATH` |
144+
| machine | `-Machine` | `-MachinePath` | `SilMachineVersion` | `SILMACHINE_PATH` |
142145

143146
## See Also
144147

0 commit comments

Comments
 (0)