Skip to content

Improve and expose package token replacement as a feature#22

Merged
kzu merged 1 commit into
mainfrom
dev/tokens
Jul 14, 2026
Merged

Improve and expose package token replacement as a feature#22
kzu merged 1 commit into
mainfrom
dev/tokens

Conversation

@kzu

@kzu kzu commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Rename @(ReadmeReplacementToken) to @(PackageReplacementToken) (aligned with NuGet/NuGetizer; last value wins for duplicates so both packages can coexist).
  • Extract default token population into CollectReplacementTokens so consumers can add tokens anytime, inject pre-work via CollectReplacementTokensDependsOn, or remove/override after the target runs.
  • Rename pack pipeline to ProcessPackageReadme (target, task, and ProcessPackageReadmeDependsOn) — it handles includes, tokens, and GitHub URL expansion.
  • Add public ReplacePackageTokens task for arbitrary files (InputFile / OutputFile / Tokens), suitable for incremental Inputs/Outputs targets. Unknown remaining $token$ placeholders emit RDM001 (suppressible via NoWarn); readme processing does not warn.
  • Document token extensibility and an EULA-style replacement example in readme.md.

Test plan

  • Unit tests for TokenReplacer, ProcessPackageReadme, ReplacePackageTokens (incl. RDM001), targets wiring
  • Pack scenario tests (SDK Pack + NuGetizer)
  • CI green on this PR

…ckageTokens

Make $token$ replacement a first-class extensibility surface rather than a
readme-only side effect of ProcessPackageReadmeIncludes.

- Rename @(ReadmeReplacementToken) to @(PackageReplacementToken) (same name as
  NuGetizer; last value wins so both packages can coexist without failing)
- Extract default token population into CollectReplacementTokens so consumers
  can inject, remove, or override values AfterTargets that collect
- Rename ProcessPackageReadmeIncludes / ProcessReadmeIncludes to
  ProcessPackageReadme (includes + tokens + GitHub URL expansion)
- Add ReplacePackageTokens task for arbitrary InputFile/OutputFile processing
  with incremental Inputs/Outputs; warn RDM001 on unknown placeholders
  (NoWarn-suppressible). Readme processing intentionally does not warn.
- Document token extensibility and EULA-style file replacement in readme.md
@kzu kzu added the enhancement New feature or request label Jul 14, 2026
@kzu
kzu enabled auto-merge (rebase) July 14, 2026 22:32
@kzu kzu changed the title Rename package tokens and expose CollectReplacementTokens + ReplacePackageTokens Improve and expose package token replacement as a feature Jul 14, 2026
@kzu

kzu commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

89 passed 89 passed

🧪 Details on Ubuntu 24.04.4 LTS

from retest v1.1.0 on .NET 10.0.10 with 💜 by @devlooped

@kzu
kzu merged commit 46ef8d6 into main Jul 14, 2026
3 checks passed
@kzu
kzu deleted the dev/tokens branch July 14, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant