Skip to content

Commit 83d60dd

Browse files
Pack only FieldWorks-relevant SIL.Machine projects (#808)
Avoid building native CMake dependencies (SentencePiece) by packing SIL.Machine and SIL.Machine.Morphology.HermitCrab individually instead of the whole repo. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 21f1f82 commit 83d60dd

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

Build/Manage-LocalLibraries.ps1

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ $LibraryConfig = @{
125125
PdbRelativeDir = 'bin/Debug/netstandard2.0'
126126
CachePrefixes = @('sil.machine')
127127
EnvVar = 'SILMACHINE_PATH'
128+
# Pack only the projects FieldWorks uses (avoids native CMake deps)
129+
PackProjects = @(
130+
'src/SIL.Machine/SIL.Machine.csproj',
131+
'src/SIL.Machine.Morphology.HermitCrab/SIL.Machine.Morphology.HermitCrab.csproj'
132+
)
128133
}
129134
}
130135

@@ -222,18 +227,28 @@ function Invoke-PackLibrary {
222227
$packStart = Get-Date
223228

224229
Write-Host "Running dotnet pack..." -ForegroundColor Cyan
225-
$packArgs = @(
226-
'pack'
227-
$SourceDir
230+
$commonPackArgs = @(
228231
'-c', 'Debug'
229232
"-p:IncludeSymbols=true"
230233
"-p:SymbolPackageFormat=snupkg"
231234
'--output', $LocalRepo
232235
)
233236

234-
& dotnet @packArgs
235-
if ($LASTEXITCODE -ne 0) {
236-
throw "dotnet pack failed for $LibName."
237+
$projects = $cfg.PackProjects
238+
if ($projects -and $projects.Count -gt 0) {
239+
foreach ($proj in $projects) {
240+
$projPath = Join-Path $SourceDir $proj
241+
& dotnet pack $projPath @commonPackArgs
242+
if ($LASTEXITCODE -ne 0) {
243+
throw "dotnet pack failed for $LibName ($proj)."
244+
}
245+
}
246+
}
247+
else {
248+
& dotnet pack $SourceDir @commonPackArgs
249+
if ($LASTEXITCODE -ne 0) {
250+
throw "dotnet pack failed for $LibName."
251+
}
237252
}
238253

239254
# Find .nupkg files created after pack started (exclude .snupkg and test pkgs)

0 commit comments

Comments
 (0)