Preserve one reviewed literal compiler define condition
ProprietaryMoves one exact old-target DefineConstants condition to an already declared replacement in one SHA-sealed project with a sealed source-stream policy inventory. Standalone opt-in requiring owner review of the payload, overrides and absent policy; does not infer custom-symbol portability or graph neutrality.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. PreserveReviewedLiteralDefineConditionRequired
Relative slash-separated .csproj path without globs or parent segments.
Lowercase SHA-256 of UTF-8 XmlParser.Print before this leaf, including BOM if printed. Retarget first, review and seal that exact document.
Exact literal net8.0 or net9.0 removed from the declared targets.
Exact literal net9.0 or net10.0 already declared; must be newer than the old target.
Exact literal semicolon-separated ASCII compiler identifiers, without property expansion or appending.
Sorted newline-separated relative .props/.targets paths, each followed by = and lowercase SHA-256 of its UTF-8 printed XML. All and only policy documents in the scanned source stream must match. Empty inventory is the literal none. Disk-only, ancestor, SDK, package and CI policy still require owner review.
Default false. Owner accepts this exact payload at its original position for the new declared target and global overrides; reviews every consumer, ancestor/import/package/environment/CI policy including absent captures. Owner confirms no consumers affect restore dependencies, project references or target metadata. This manual acceptance is not MSBuild evaluation or graph attestation.
mod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. PreserveReviewedLiteralDefineCondition \
-P ExactProjectPath= '<ExactProjectPath>' \
-P PrintedProjectSha256= '<PrintedProjectSha256>' \
-P OldTarget= '<OldTarget>' \
-P NewTarget= '<NewTarget>' \
-P ReviewedDefinePayload= '<ReviewedDefinePayload>' \
-P CapturedPolicyInventory= '<CapturedPolicyInventory>' \
-P OwnerPolicyReviewed= falseRequired options ExactProjectPath, PrintedProjectSha256, OldTarget, NewTarget, ReviewedDefinePayload, CapturedPolicyInventory have no example to run with. Fill them in above.
Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.