From ba1cfccc3f85ac2fa63a2bb8e115fcd866fc39aa Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Thu, 2 Apr 2026 09:42:17 -0700 Subject: [PATCH] Add SIL.Machine as a local library option Support packing and versioning SIL.Machine alongside the existing liblcm, libpalaso, and chorus libraries. Uses LIBMACHINE_PATH env var and -Machine/-MachinePath parameters. Co-Authored-By: Claude Opus 4.6 --- Build/Manage-LocalLibraries.ps1 | 27 ++++++++++++++++---- Docs/architecture/local-library-debugging.md | 11 +++++--- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Build/Manage-LocalLibraries.ps1 b/Build/Manage-LocalLibraries.ps1 index a9ea48cb20..218c840370 100644 --- a/Build/Manage-LocalLibraries.ps1 +++ b/Build/Manage-LocalLibraries.ps1 @@ -6,7 +6,7 @@ Two modes of operation: Pack mode (one or more source paths provided): - Packs local checkouts of liblcm, libpalaso, and/or chorus into the + Packs local checkouts of liblcm, libpalaso, chorus, and/or machine into the local NuGet feed using each library's own version. Detects the version from produced packages, updates SilVersions.props to match, copies PDBs, and clears stale cached packages. @@ -44,9 +44,16 @@ Path to a local chorus checkout. Overrides LIBCHORUS_PATH env var. Only used when -Chorus is specified. +.PARAMETER Machine + Switch: include SIL.Machine in the pack operation. + +.PARAMETER MachinePath + Path to a local machine checkout. Overrides SILMACHINE_PATH env var. + Only used when -Machine is specified. + .PARAMETER Library Which library to set a version for (SetVersion mode only): - liblcm, libpalaso, or chorus. + liblcm, libpalaso, chorus, or machine. .PARAMETER Version Sets the version in SilVersions.props (SetVersion mode). Use to revert @@ -75,7 +82,10 @@ param( [switch]$Chorus, [string]$ChorusPath, - [ValidateSet('liblcm', 'libpalaso', 'chorus')] + [switch]$Machine, + [string]$MachinePath, + + [ValidateSet('liblcm', 'libpalaso', 'chorus', 'machine')] [string]$Library, [string]$Version @@ -110,10 +120,16 @@ $LibraryConfig = @{ CachePrefixes = @('sil.chorus') EnvVar = 'LIBCHORUS_PATH' } + machine = @{ + VersionProperty = 'SilMachineVersion' + PdbRelativeDir = 'bin/Debug/netstandard2.0' + CachePrefixes = @('sil.machine') + EnvVar = 'SILMACHINE_PATH' + } } # Pack order: libpalaso first (other libraries may depend on it) -$PackOrder = @('libpalaso', 'liblcm', 'chorus') +$PackOrder = @('libpalaso', 'liblcm', 'chorus', 'machine') # --------------------------------------------------------------------------- # Read SilVersions.props @@ -301,6 +317,7 @@ $switchMap = @{ libpalaso = @{ Enabled = [bool]$Palaso; ExplicitPath = $PalasoPath } liblcm = @{ Enabled = [bool]$Lcm; ExplicitPath = $LcmPath } chorus = @{ Enabled = [bool]$Chorus; ExplicitPath = $ChorusPath } + machine = @{ Enabled = [bool]$Machine; ExplicitPath = $MachinePath } } # Resolve source paths: explicit path > env var (only when switch is set) @@ -387,5 +404,5 @@ elseif ($Library -and $Version) { Write-Host "Run .\build.ps1 to restore and build with the new version." -ForegroundColor Cyan } else { - 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" + 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" } diff --git a/Docs/architecture/local-library-debugging.md b/Docs/architecture/local-library-debugging.md index d64acc15dc..4baee6e7de 100644 --- a/Docs/architecture/local-library-debugging.md +++ b/Docs/architecture/local-library-debugging.md @@ -1,6 +1,6 @@ # Local Library Debugging -This document describes how to debug locally-modified versions of **liblcm**, **libpalaso**, or **chorus** in FieldWorks using a local NuGet feed. +This document describes how to debug locally-modified versions of **liblcm**, **libpalaso**, **chorus**, or **machine** (SIL.Machine) in FieldWorks using a local NuGet feed. ## Overview @@ -44,6 +44,7 @@ The script automatically registers this folder as a NuGet source in your user-le git clone https://github.com/sillsdev/liblcm.git git clone https://github.com/sillsdev/libpalaso.git git clone https://github.com/sillsdev/chorus.git +git clone https://github.com/sillsdev/machine.git ``` ## Pack a local library @@ -59,9 +60,10 @@ git clone https://github.com/sillsdev/chorus.git Or set environment variables so you can omit the paths: ```powershell -$env:LIBPALASO_PATH = "C:\Repos\libpalaso" -$env:LIBLCM_PATH = "C:\Repos\liblcm" -$env:LIBCHORUS_PATH = "C:\Repos\chorus" +$env:LIBPALASO_PATH = "C:\Repos\libpalaso" +$env:LIBLCM_PATH = "C:\Repos\liblcm" +$env:LIBCHORUS_PATH = "C:\Repos\chorus" +$env:SILMACHINE_PATH = "C:\Repos\machine" # Switches still required — env vars only provide the path .\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus @@ -139,6 +141,7 @@ dotnet nuget remove source local | liblcm | `-Lcm` | `-LcmPath` | `SilLcmVersion` | `LIBLCM_PATH` | | libpalaso | `-Palaso` | `-PalasoPath` | `SilLibPalasoVersion` | `LIBPALASO_PATH` | | chorus | `-Chorus` | `-ChorusPath` | `SilChorusVersion` | `LIBCHORUS_PATH` | +| machine | `-Machine` | `-MachinePath` | `SilMachineVersion` | `SILMACHINE_PATH` | ## See Also