|
| 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