Skip to content

[build] Replace TPN generation with checked-in file + skill#11284

Open
jonathanpeppers wants to merge 6 commits intomainfrom
jonathanpeppers/audit-xaprepare-tpns
Open

[build] Replace TPN generation with checked-in file + skill#11284
jonathanpeppers wants to merge 6 commits intomainfrom
jonathanpeppers/audit-xaprepare-tpns

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

Summary

Phase 2: Replace the xaprepare TPN generation infrastructure with a checked-in THIRD-PARTY-NOTICES.TXT file and a Copilot skill for future maintenance.

Changes

Merged TPN file

  • Combined both TPN sets (build-deps + shipped-deps) into a single THIRD-PARTY-NOTICES.TXT at the repo root (26 entries)
  • Uses the MicrosoftOSS header format (same as the shipped version)

Updated packaging

  • License.targets and create-installers.targets now reference $(XamarinAndroidSourcePath)THIRD-PARTY-NOTICES.TXT (the checked-in file) instead of $(XAInstallPrefix)THIRD-PARTY-NOTICES.TXT (the generated one)

Deleted ~31 files of TPN generation code (-2551 lines)

  • 7 infrastructure classes (ThirdPartyNotice, ThirdPartyNoticeGroup, TPNAttribute, ThirdPartyLicenseType, CommonLicenses, Step_ThirdPartyNotices, Scenario_ThirdPartyNotices)
  • 19 TPN definition files in ThirdPartyNotices/
  • 1 dead CreateThirdPartyNotices MSBuild task (never invoked from any .targets)
  • 4 license-data template files (Apache-2.0.txt, GPLv2.txt, GPLv3.txt, Mono-MIT.txt)
  • Removed Step_ThirdPartyNotices from Scenario_Standard.cs

Added update-tpn skill

  • .github/skills/update-tpn/SKILL.md with full dependency catalog (all URLs, license file paths) and audit workflow for maintaining the TPN file going forward

Delete ~31 files of xaprepare TPN generation infrastructure:
- ThirdPartyNotice/ThirdPartyNoticeGroup base classes, TPNAttribute,
  ThirdPartyLicenseType, CommonLicenses, Step_ThirdPartyNotices,
  Scenario_ThirdPartyNotices
- All 19 TPN definition files in ThirdPartyNotices/
- Dead CreateThirdPartyNotices MSBuild task
- license-data/ template files (Apache-2.0, GPLv2, GPLv3, Mono-MIT)

Merge both TPN sets (build-deps + shipped-deps) into a single
THIRD-PARTY-NOTICES.TXT at the repo root (26 entries).

Update packaging (License.targets, create-installers.targets) to
reference the checked-in file instead of the generated one.

Add .github/skills/update-tpn/SKILL.md with full dependency catalog
and audit workflow for maintaining the TPN file going forward.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 4, 2026 21:10
Use upstream URL (Tessil/robin-map) instead of fork (xamarin/robin-map)
to match the TPN entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the xaprepare-based third-party notices (TPN) generation pipeline and replaces it with a single checked-in THIRD-PARTY-NOTICES.TXT at the repo root, plus a new update-tpn skill to guide future audits/updates.

Changes:

  • Check in a merged THIRD-PARTY-NOTICES.TXT (build + shipped dependencies) using the Microsoft OSS header format.
  • Update NuGet/installer packaging targets to ship the checked-in TPN file instead of a generated $(XAInstallPrefix) file.
  • Delete the xaprepare TPN generation infrastructure (scenario/step/types/data) and the unused prep task + license-data templates; add a new .github/skills/update-tpn skill doc.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
THIRD-PARTY-NOTICES.TXT Replaces the old generated notices with a single checked-in merged TPN file.
build-tools/installers/create-installers.targets Switch installer TPN input from generated $(XAInstallPrefix) to checked-in $(XamarinAndroidSourcePath) file.
build-tools/create-packs/License.targets Switch NuGet packaging to include the checked-in root TPN file.
.github/skills/update-tpn/SKILL.md Adds a skill/workflow doc for auditing/updating the checked-in TPN file.
build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs Stops running TPN generation as part of the standard xaprepare scenario.
build-tools/xaprepare/xaprepare/Steps/Step_ThirdPartyNotices.cs Removes the step that generated TPN files.
build-tools/xaprepare/xaprepare/Scenarios/Scenario_ThirdPartyNotices.cs Removes the dedicated scenario for generating TPN files.
build-tools/xaprepare/xaprepare/ConfigAndData/CommonLicenses.cs Removes shared license-template path constants used only by the removed TPN generator.
build-tools/xaprepare/xaprepare/Application/TPNAttribute.cs Removes the attribute used to discover TPN entries.
build-tools/xaprepare/xaprepare/Application/ThirdPartyNoticeGroup.cs Removes TPN grouping type used only by the removed generator.
build-tools/xaprepare/xaprepare/Application/ThirdPartyNotice.cs Removes the base type for generator-driven TPN entries.
build-tools/xaprepare/xaprepare/Application/ThirdPartyLicenseType.cs Removes generator-specific license header selection enum.
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/CreateThirdPartyNotices.cs Removes an unused MSBuild task for generating TPN output.
build-tools/license-data/Apache-2.0.txt Removes template license text file (no longer needed without generation).
build-tools/license-data/GPLv2.txt Removes template license text file (no longer needed without generation).
build-tools/license-data/GPLv3.txt Removes template license text file (no longer needed without generation).
build-tools/license-data/Mono-MIT.txt Removes template license text file (no longer needed without generation).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/aapt2.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/bionic.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/bundletool.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/ELFSharp.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/Java.Interop.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/K4os.Compression.LZ4.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/libunwind.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/lz4.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs Removes per-dependency TPN definitions/grouping (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/r8.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/robin-map.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/StrongNameSigner.cs Removes per-dependency TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Build.Tasks.cs Removes per-component TPN definitions/grouping (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.NunitLite.cs Removes per-component TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.Aidl.cs Removes per-component TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.JavadocImporter.cs Removes per-component TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/xaprepare.cs Removes per-component TPN definition (generator no longer used).
build-tools/xaprepare/xaprepare/ThirdPartyNotices/xxHash.cs Removes per-dependency TPN definitions (generator no longer used).

Comment thread .github/skills/update-tpn/SKILL.md
Show actual fork URLs from .gitmodules for lz4 (dotnet/lz4) and
robin-map (xamarin/robin-map), with upstream URLs noted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers
Copy link
Copy Markdown
Member Author

/review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Android PR Reviewer completed successfully!

@jonathanpeppers
Copy link
Copy Markdown
Member Author

Compared the checked-in THIRD-PARTY-NOTICES.TXT against the file generated from main (the shipped-only version). The only differences are:

  1. 4 new entries merged in from the build-deps set: chys87/constexpr-xxh3, Cyan4973/xxHash, force-net/crc32.net, tessil/robin-map
  2. Renumbering (22 → 26 entries)
  3. License text sections for those 4 entries

All 22 entries from the shipped version are preserved exactly as-is.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM

Clean, well-structured removal of ~2,550 lines of TPN generation infrastructure, replaced by a checked-in THIRD-PARTY-NOTICES.TXT and a Copilot skill for future maintenance.

What I verified

  • No dangling references — all 31 deleted files (7 infra classes, 19 TPN definitions, 4 license templates, 1 dead MSBuild task) have zero remaining references in .cs, .csproj, .targets, or .props files
  • TPN completeness — 26 TOC entries match 26 %% license sections; entries match the skill's dependency inventory (submodules, vendored source, NuGet packages, vendored linker, SDK tools, libzip)
  • MSBuild path change is sound$(XamarinAndroidSourcePath) is already defined in Configuration.props and used extensively in License.targets itself (lines 9–10); switching from $(XAInstallPrefix) eliminates the dependency on xaprepare generating the file before packaging
  • Old checked-in TPN entries preserved — all 7 original entries (android/platform/tools/base, bazel, constexpr-xxh3, xxHash, crc32.net, nunitlite, robin-map) are present in the merged file alongside the 19 former "shipped" entries
  • Step_CopyExtraResultFilesForCI still works — it searches XamarinAndroidSourceRoot for THIRD-PARTY-NOTICES.TXT, which now resolves to the checked-in file
  • CI — both public checks passing (license/cla ✅, dotnet-android ✅)

Issue summary

Severity Count
💡 Suggestion 1

One minor suggestion on the skill's verification step using a PowerShell-only cmdlet.

Generated by Android PR Reviewer for issue #11284 · ● 10M

Comment thread .github/skills/update-tpn/SKILL.md Outdated
jonathanpeppers and others added 2 commits May 4, 2026 16:34
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No longer needed since the file is checked into the repo instead of
generated at build time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers
Copy link
Copy Markdown
Member Author

Verified the THIRD-PARTY-NOTICES.TXT inside the shipped .nupkg from build 14011353 matches our checked-in file exactly (identical after normalizing line endings).

Extracted from Microsoft.Android.Sdk.Darwin.36.99.0-ci.pr.gh11284.176.nupkg — same 26 entries, same license text content.

@jonathanpeppers jonathanpeppers added ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). and removed ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). labels May 5, 2026
The GPLv3 license text (gnu/binutils) uses "countries" and "country"
which are flagged by PoliCheck geopolitical rules. These are verbatim
license terms that cannot be modified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers marked this pull request as draft May 5, 2026 16:00
@jonathanpeppers jonathanpeppers marked this pull request as draft May 5, 2026 16:00
@jonathanpeppers
Copy link
Copy Markdown
Member Author

OK, latest commit fixes PoliCheck.

@jonathanpeppers jonathanpeppers marked this pull request as ready for review May 5, 2026 17:43
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants