Skip to content

Conversation

@joseharriaga
Copy link
Collaborator

@joseharriaga joseharriaga commented Jan 23, 2026

  • Replaced the GenAPI tool with the GenAPI MSBuild task, which is able to automatically pull all assembly dependencies at build time. This means that we no longer need to manually maintain a list of dependencies just so that we can pass them to the GenAPI tool.
  • Added the public .NET dev feed to our nuget.config from where the GenAPI MSBuild task can be restored. This means that we no longer need to manually build and install a copy of the GenAPI tool locally.

@joseharriaga
Copy link
Collaborator Author

@copilot Modify the Export-Api.ps1 script in this PR so that it deletes the contents of the "api" folder before running the GenAPI task.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@joseharriaga I've opened a new pull request, #910, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Delete api folder contents before running GenAPI

Co-authored-by: joseharriaga <[email protected]>

* Add error handling and recursive cleanup for api folder

Co-authored-by: joseharriaga <[email protected]>

* Optimize api folder cleanup command

Co-authored-by: joseharriaga <[email protected]>

* Use Join-Path for cross-platform compatibility

Co-authored-by: joseharriaga <[email protected]>

* Ensure cleanup includes hidden files

Co-authored-by: joseharriaga <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joseharriaga <[email protected]>
@joseharriaga
Copy link
Collaborator Author

@copilot Simplify the changes in this PR by taking the following into consideration:

  1. The Export-Api.ps1 script does not need the Configuration parameter. It should always be "Release".
  2. The Export-Api.ps1 script does not need the TargetFramework parameter. It should always use all the TFMs specified in the .csproj file.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@joseharriaga I've opened a new pull request, #911, to work on those changes. Once the pull request is ready, I'll request review from you.

… parameters (#911)

- **Removed `Configuration` parameter** - Now hardcoded to "Release"
- **Removed `TargetFramework` parameter** - Always processes all TFMs from `ClientTargetFrameworks` in Directory.Build.props
- **Updated script documentation** - Removed parameter documentation and examples to reflect single-purpose behavior
- **Fixed MSBuild invocation** - Modified script to explicitly iterate over each target framework (net10.0, net8.0, netstandard2.0) to ensure the ExportApi MSBuild target runs correctly for multi-targeted projects
@joseharriaga
Copy link
Collaborator Author

@copilot The current Export-Api.ps1 script in this PR runs dotnet build once for each target framework. Is it necessary to run them one by one? Or is it possible to run them all at once? Would the GenAPI target support that?

Copilot AI mentioned this pull request Jan 27, 2026
Copy link
Contributor

Copilot AI commented Jan 27, 2026

@joseharriaga I've opened a new pull request, #918, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits January 26, 2026 21:31
- **MSBuild Integration**: Added `ExportApi` target in `Directory.Build.targets` that uses an outer/inner build pattern to automatically handle all target frameworks
  - **Outer build target**: Dispatches to inner builds for each target framework when building a multi-targeted project
  - **Inner build target** (`ExportApiInner`): Invokes GenAPITask for each specific target framework
- **Export Script**: Created `Export-Api.ps1` PowerShell script that:
  - Cleans the `api/` folder before generation
  - Runs a single build command with the `ExportApi` target (MSBuild automatically handles all TFMs: net10.0, net8.0, netstandard2.0)
  - Post-processes generated files to remove fully-qualified names, internal APIs, and unwanted attributes
  - Always uses Release configuration
@joseharriaga joseharriaga changed the title Add GenAPI MSBuild Task [EngSys] Replace GenAPI tool with GenAPI MSBuild task in Export-Api.ps1 Jan 27, 2026
@joseharriaga joseharriaga marked this pull request as ready for review January 27, 2026 05:57
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@joseharriaga joseharriaga merged commit 453a609 into main Jan 28, 2026
1 check passed
@joseharriaga joseharriaga deleted the joseharriaga/ExportApi-Public branch January 28, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants