Skip to content

Commit a12287e

Browse files
committed
Use local package workflow for SIL dependencies
1 parent 8468561 commit a12287e

17 files changed

Lines changed: 1411 additions & 1353 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Collection.cpp
44
.vs/
55
Build/GlobalInclude.properties
66
Build/LibraryDevelopment.properties
7+
Build/SilVersions.Local.props
78
Build/NuGet.exe
89
Build/nunit.framework.dll
910
Build/nunit.framework.xml

.vscode/launch.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@
1818
}
1919
},
2020
{
21-
"name": "FieldWorks (.NET Framework, Local LCM)",
21+
"name": "FieldWorks (.NET Framework, Local Packages)",
2222
"type": "clr",
2323
"request": "launch",
24-
"preLaunchTask": "Prepare Debug (Local LCM)",
24+
"preLaunchTask": "Prepare Debug (Local Packages)",
2525
"program": "${workspaceFolder}\\Output\\Debug\\FieldWorks.exe",
2626
"cwd": "${workspaceFolder}\\Output\\Debug",
2727
"console": "externalTerminal",
2828
"justMyCode": false,
2929
"requireExactSource": false,
3030
"symbolOptions": {
3131
"searchPaths": [
32-
"${workspaceFolder}\\Output\\Debug",
33-
"${workspaceFolder}\\Localizations\\LCM\\artifacts\\Debug\\net462"
32+
"${workspaceFolder}\\Output\\Debug"
3433
]
3534
}
3635
},

.vscode/tasks.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@
211211
{
212212
"label": "Build",
213213
"type": "shell",
214-
"command": "./build.ps1 -LcmMode Auto",
214+
"command": "./build.ps1",
215215
"group": {
216216
"kind": "build",
217217
"isDefault": true
218218
},
219-
"detail": "Build FieldWorks (package-backed by default; use explicit local LCM tasks for source mode)",
219+
"detail": "Build FieldWorks against the pinned dependency packages",
220220
"options": {
221221
"shell": {
222222
"executable": "powershell.exe",
@@ -228,9 +228,9 @@
228228
{
229229
"label": "Build (Package)",
230230
"type": "shell",
231-
"command": "./build.ps1 -LcmMode Package",
231+
"command": "./build.ps1",
232232
"group": "build",
233-
"detail": "Build FieldWorks against the pinned liblcm packages",
233+
"detail": "Build FieldWorks against the pinned dependency packages",
234234
"options": {
235235
"shell": {
236236
"executable": "powershell.exe",
@@ -242,9 +242,9 @@
242242
{
243243
"label": "Build (Package, VS Code Debug)",
244244
"type": "shell",
245-
"command": "./build.ps1 -LcmMode Package -ManagedDebugType portable",
245+
"command": "./build.ps1 -ManagedDebugType portable",
246246
"group": "build",
247-
"detail": "Build FieldWorks against pinned liblcm packages with portable managed PDBs for the VS Code debugger",
247+
"detail": "Build FieldWorks against pinned dependency packages with portable managed PDBs for the VS Code debugger",
248248
"options": {
249249
"shell": {
250250
"executable": "powershell.exe",
@@ -256,9 +256,9 @@
256256
{
257257
"label": "Prepare Debug (Package)",
258258
"type": "shell",
259-
"command": "./Build/Agent/Invoke-VsCodeDebugBuild.ps1 -LcmMode Package -ManagedDebugType portable",
259+
"command": "./Build/Agent/Invoke-VsCodeDebugBuild.ps1 -ManagedDebugType portable",
260260
"group": "build",
261-
"detail": "Build for VS Code debugging only when relevant files changed since the last successful package-mode portable-PDB debug build",
261+
"detail": "Build for VS Code debugging only when relevant files changed since the last successful portable-PDB package-mode debug build",
262262
"options": {
263263
"shell": {
264264
"executable": "powershell.exe",
@@ -268,11 +268,11 @@
268268
"problemMatcher": "$msCompile"
269269
},
270270
{
271-
"label": "Build (Local LCM)",
271+
"label": "Build (Local Packages)",
272272
"type": "shell",
273-
"command": "./build.ps1 -LcmMode Local",
273+
"command": "./build.ps1 -LocalPalaso -LocalLcm -LocalChorus",
274274
"group": "build",
275-
"detail": "Build FieldWorks against the nested Localizations/LCM checkout",
275+
"detail": "Pack libpalaso first, then liblcm and chorus in parallel, then build FieldWorks against those local packages",
276276
"options": {
277277
"shell": {
278278
"executable": "powershell.exe",
@@ -282,11 +282,11 @@
282282
"problemMatcher": "$msCompile"
283283
},
284284
{
285-
"label": "Build (Local LCM, VS Code Debug)",
285+
"label": "Build (Local Packages, VS Code Debug)",
286286
"type": "shell",
287-
"command": "./build.ps1 -LcmMode Local -ManagedDebugType portable",
287+
"command": "./build.ps1 -LocalPalaso -LocalLcm -LocalChorus -ManagedDebugType portable",
288288
"group": "build",
289-
"detail": "Build FieldWorks against the nested local LCM checkout with portable managed PDBs for the VS Code debugger",
289+
"detail": "Build FieldWorks against locally packed dependency packages with portable FieldWorks PDBs for the VS Code debugger",
290290
"options": {
291291
"shell": {
292292
"executable": "powershell.exe",
@@ -296,11 +296,11 @@
296296
"problemMatcher": "$msCompile"
297297
},
298298
{
299-
"label": "Prepare Debug (Local LCM)",
299+
"label": "Prepare Debug (Local Packages)",
300300
"type": "shell",
301-
"command": "./Build/Agent/Invoke-VsCodeDebugBuild.ps1 -LcmMode Local -ManagedDebugType portable",
301+
"command": "./build.ps1 -LocalPalaso -LocalLcm -LocalChorus -ManagedDebugType portable",
302302
"group": "build",
303-
"detail": "Build for VS Code debugging only when relevant files changed since the last successful local-LCM portable-PDB debug build",
303+
"detail": "Pack the local dependency repos and build FieldWorks for VS Code debugging",
304304
"options": {
305305
"shell": {
306306
"executable": "powershell.exe",

Build/Agent/Invoke-VsCodeDebugBuild.ps1

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[CmdletBinding()]
22
param(
3-
[ValidateSet('Package', 'Local')]
4-
[string]$LcmMode,
53
[ValidateSet('Debug', 'Release')]
64
[string]$Configuration = 'Debug',
75
[ValidateSet('full', 'portable', 'pdbonly', 'embedded')]
@@ -16,28 +14,22 @@ $stampPath = Join-Path $outputDir 'BuildStamp.json'
1614
$runtimeExePath = Join-Path $outputDir 'FieldWorks.exe'
1715

1816
function Get-DebugRebuildCheckPathspecs {
19-
param(
20-
[Parameter(Mandatory = $true)][ValidateSet('Package', 'Local')][string]$ResolvedLcmMode
21-
)
22-
2317
$pathspecs = @(
2418
'build.ps1',
19+
'test.ps1',
20+
'nuget.config',
2521
'Directory.Build.props',
2622
'Directory.Build.targets',
2723
'Directory.Packages.props',
24+
'Build/SilVersions.props',
25+
'Build/SilVersions.Local.props',
2826
'FieldWorks.proj',
27+
'FieldWorks.sln',
2928
'Build',
3029
'Src',
3130
'Lib'
3231
)
3332

34-
if ($ResolvedLcmMode -eq 'Local') {
35-
$pathspecs += @('FieldWorks.LocalLcm.sln', 'Localizations/LCM')
36-
}
37-
else {
38-
$pathspecs += 'FieldWorks.sln'
39-
}
40-
4133
return $pathspecs | ForEach-Object { $_ -replace '\\', '/' }
4234
}
4335

@@ -118,8 +110,6 @@ function Invoke-DebugBuild {
118110
'Bypass',
119111
'-File',
120112
(Join-Path $repoRoot 'build.ps1'),
121-
'-LcmMode',
122-
$LcmMode,
123113
'-Configuration',
124114
$Configuration,
125115
'-ManagedDebugType',
@@ -139,18 +129,16 @@ if (-not (Test-Path $stampPath) -or -not (Test-Path $runtimeExePath)) {
139129
}
140130

141131
$stamp = Get-Content -LiteralPath $stampPath -Raw | ConvertFrom-Json
142-
$resolvedLcmMode = if ($LcmMode -eq 'Local') { 'Local' } else { 'Package' }
143-
144-
$modeMatches = ($stamp.PSObject.Properties.Name -contains 'ResolvedLcmMode') -and ($stamp.ResolvedLcmMode -eq $resolvedLcmMode)
132+
$localDependencyMatches = ($stamp.PSObject.Properties.Name -contains 'LocalDependencies') -and (@($stamp.LocalDependencies).Count -eq 0)
145133
$debugTypeMatches = ($stamp.PSObject.Properties.Name -contains 'ManagedDebugType') -and ($stamp.ManagedDebugType -eq $ManagedDebugType)
146134

147-
if (-not $modeMatches -or -not $debugTypeMatches) {
135+
if (-not $localDependencyMatches -or -not $debugTypeMatches) {
148136
Write-Host "Build stamp mode does not match requested VS Code debug mode. Rebuilding..." -ForegroundColor Yellow
149137
Invoke-DebugBuild
150138
exit 0
151139
}
152140

153-
$pathspecsToCheck = Get-DebugRebuildCheckPathspecs -ResolvedLcmMode $resolvedLcmMode
141+
$pathspecsToCheck = Get-DebugRebuildCheckPathspecs
154142
if (Test-GitStateRequiresDebugRebuild -Stamp $stamp -Pathspecs $pathspecsToCheck) {
155143
Invoke-DebugBuild
156144
exit 0

0 commit comments

Comments
 (0)