Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 22 additions & 5 deletions Build/Manage-LocalLibraries.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
}
11 changes: 7 additions & 4 deletions Docs/architecture/local-library-debugging.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading