KEMBAR78
Fix public api cake by PureWeen · Pull Request #30695 · dotnet/maui · GitHub
Skip to content

Conversation

PureWeen
Copy link
Member

Description of Change

Add cake target that we can use to regenerate all the PublicAPI.txt files

This will delete all the content and regenerate because sometimes it can't quite reorganize or modify correctly.

I realize this one also has a lot of txt file changes. Hopefully this will get all of those files into a state that runs consistently with this target.

This pull request introduces a new process for managing PublicAPI files and addresses related build issues. It includes updates to documentation, a new Cake task for automating PublicAPI management, and changes to the PublicAPI.Unshipped.txt files to reflect recent API updates.

PublicAPI Management Enhancements:

  • Documentation Updates:

    • Added a section in .github/DEVELOPMENT.md explaining how to manually generate PublicAPI.Unshipped.txt files using the PublicApiType=Generate property during builds.
    • Updated docs/DevelopmentTips.md to include a new --target=publicapi parameter for the dotnet cake command, which automates clearing and regenerating PublicAPI.Unshipped.txt files.
  • New Cake Task:

    • Added a publicapi task in eng/cake/dotnet.cake to clear and regenerate PublicAPI.Unshipped.txt files across all projects (Core, Controls, Essentials, Graphics). The task skips Windows-specific files on non-Windows platforms and always skips Tizen files.

These changes aim to streamline the PublicAPI management process and ensure the API definitions are up-to-date and consistent across the codebase.

@Copilot Copilot AI review requested due to automatic review settings July 17, 2025 21:50
@PureWeen PureWeen requested a review from a team as a code owner July 17, 2025 21:50
@PureWeen PureWeen requested review from jfversluis and rmarinho July 17, 2025 21:50
Copy link
Contributor

@Copilot 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 pull request introduces a new Cake build target to automate the management of PublicAPI files across the .NET MAUI repository. The main purpose is to streamline the process of regenerating PublicAPI.Unshipped.txt files when new public APIs are added, helping developers resolve build errors more efficiently.

Key Changes:

  • Added a new publicapi Cake task that clears and regenerates all PublicAPI.Unshipped.txt files across Core, Controls, Essentials, and Graphics projects
  • Updated development documentation with instructions for manual PublicAPI generation and the new automated Cake target
  • Regenerated multiple PublicAPI.Unshipped.txt files with consistent formatting and updated API declarations

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.

File Description
eng/cake/dotnet.cake Added new publicapi task to automate clearing and regenerating PublicAPI files
docs/DevelopmentTips.md Added documentation for the new --target=publicapi parameter
.github/DEVELOPMENT.md Added section explaining manual PublicAPI file generation
src//PublicAPI//PublicAPI.Unshipped.txt Multiple files updated with consistent formatting (BOM addition) and API reorganization
Comments suppressed due to low confidence (1)

@PureWeen PureWeen force-pushed the fix_public_api_cake branch from 3ee8167 to 2f81478 Compare July 17, 2025 22:00
@PureWeen
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

mattleibow
mattleibow previously approved these changes Jul 17, 2025
mattleibow
mattleibow previously approved these changes Jul 17, 2025
@PureWeen PureWeen force-pushed the fix_public_api_cake branch from db7d5f3 to e4f89cd Compare July 17, 2025 23:01
@PureWeen PureWeen merged commit d0cae58 into net10.0 Jul 17, 2025
24 of 129 checks passed
@PureWeen PureWeen deleted the fix_public_api_cake branch July 17, 2025 23:28
@PureWeen
Copy link
Member Author

/backport to main

@github-actions
Copy link
Contributor

Started backporting to main: https://github.com/dotnet/maui/actions/runs/16374026941

@github-actions
Copy link
Contributor

@PureWeen backporting to "main" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Add cake target that will regenerate the public API txt files
Applying: - fix
error: sha1 information is lacking or useless (eng/cake/dotnet.cake).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 - fix
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2025
@PureWeen PureWeen added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants