Skip to content

Commit bca04ab

Browse files
committed
Extra pack scripts for convenient release with parent packages.
1 parent f8e43db commit bca04ab

2 files changed

Lines changed: 91 additions & 2 deletions

File tree

DEVELOPER_README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,28 @@ tree is dirty (override with `-Force`). After it succeeds, tag and push:
9797

9898
```powershell
9999
./build/pack-release.ps1
100-
git tag v0.13.0
101-
git push origin v0.13.0
100+
git tag v1.0.0
101+
git push origin v1.0.0
102102
```
103103

104104
Drop the `.nupkg`s into wherever your nuget.org push lives.
105105

106+
### `build/pack-parents.ps1`
107+
108+
Packs the three parent libs (FParsec-Pipes, LicenseToCIL, Rezoom) from
109+
their sibling repos at the versions declared in each fsproj. Use this when
110+
you've edited a parent and want Rezoom.SQL to pick up the fresh bits.
111+
112+
```powershell
113+
./build/pack-parents.ps1 # all three
114+
./build/pack-parents.ps1 -Only Rezoom # one at a time
115+
```
116+
117+
The parents don't participate in the centralized `version.props` mechanism
118+
(they change rarely; their versions are bumped manually). If you're
119+
publishing parent changes, bump the parent's `<Version>` first, then run
120+
this script.
121+
106122
### `src/TypeProviderUsers/test-tp-users.ps1`
107123

108124
Runs `dotnet test` on both TPU projects. SQLite can make its own DB file, but Postgres auto-

build/pack-parents.ps1

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#requires -Version 5
2+
<#
3+
.SYNOPSIS
4+
Pack the three Rezoom.SQL parent libraries into the local feed.
5+
6+
.DESCRIPTION
7+
Packs FParsec-Pipes, LicenseToCIL, and Rezoom from their sibling repos at
8+
the versions declared in each fsproj, dropping the .nupkg files into the
9+
umbrella .localfeed. Run this when you've changed a parent lib and want
10+
Rezoom.SQL (or the TPUs / demos) to pick up the fresh bits.
11+
12+
These libs are infrequently changed, so their versions are bumped manually
13+
in each fsproj. The centralized version.props mechanism only covers the
14+
Rezoom.SQL packages. If you're publishing parent changes, bump the
15+
parent's <Version> first.
16+
17+
Assumes the umbrella checkout layout: this repo lives alongside Rezoom,
18+
FParsec-Pipes, and LicenseToCIL under a common parent directory.
19+
20+
.PARAMETER Only
21+
Pack only the named parent. One of FParsec-Pipes, LicenseToCIL, Rezoom.
22+
Default: all three.
23+
#>
24+
[CmdletBinding()]
25+
param(
26+
[ValidateSet('FParsec-Pipes', 'LicenseToCIL', 'Rezoom')]
27+
[string]$Only
28+
)
29+
30+
$ErrorActionPreference = 'Stop'
31+
$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
32+
$umbrellaRoot = Split-Path -Parent $repoRoot
33+
$feed = Join-Path $umbrellaRoot '.localfeed'
34+
if (-not (Test-Path $feed)) {
35+
New-Item -ItemType Directory -Path $feed | Out-Null
36+
}
37+
38+
$parents = @(
39+
@{ Name = 'FParsec-Pipes'; Project = 'FParsec-Pipes/FParsec-Pipes/FParsec-Pipes.fsproj'; PkgId = 'fparsec-pipes' }
40+
@{ Name = 'LicenseToCIL'; Project = 'LicenseToCIL/LicenseToCIL/LicenseToCIL.fsproj'; PkgId = 'licensetocil' }
41+
@{ Name = 'Rezoom'; Project = 'Rezoom/src/Rezoom/Rezoom.fsproj'; PkgId = 'rezoom' }
42+
)
43+
if ($Only) {
44+
$parents = $parents | Where-Object { $_.Name -eq $Only }
45+
}
46+
47+
$packagesRoot = Join-Path $HOME '.nuget/packages'
48+
49+
foreach ($p in $parents) {
50+
$projPath = Join-Path $umbrellaRoot $p.Project
51+
if (-not (Test-Path $projPath)) {
52+
Write-Host "Missing $($p.Name) at $projPath. Expected sibling checkout. Skipping." -ForegroundColor Yellow
53+
continue
54+
}
55+
56+
# Read the version from the fsproj so we can clear the matching cache entry
57+
# and stay readable in the output.
58+
[xml]$proj = Get-Content $projPath
59+
$version = ($proj.Project.PropertyGroup.Version -as [string]).Trim()
60+
61+
if ($version) {
62+
$cacheDir = Join-Path $packagesRoot "$($p.PkgId)/$version"
63+
if (Test-Path $cacheDir) { Remove-Item -Recurse -Force $cacheDir }
64+
}
65+
66+
Write-Host ""
67+
Write-Host "==> pack $($p.Name) ($version)" -ForegroundColor Cyan
68+
& dotnet pack $projPath -c Release -o $feed --nologo 2>&1 | Select-Object -Last 2
69+
if ($LASTEXITCODE -ne 0) { throw "pack failed for $($p.Name)" }
70+
}
71+
72+
Write-Host ""
73+
Write-Host "Done. Packages available at $feed" -ForegroundColor Green

0 commit comments

Comments
 (0)