-
Notifications
You must be signed in to change notification settings - Fork 5k
Add generateCode target #50167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generateCode target #50167
Conversation
There was a problem hiding this 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 introduces a new MSBuild GenerateCode
target for TypeSpec-based client generation and adjusts the Event Grid Namespaces library to opt out of AutoRest and consume shared core sources manually.
- Expose a
GenerateCode
target whenIncludeAutorestDependency
is disabled and atsp-location.yaml
file is present - Toggle AutoRest package inclusion via
IncludeAutorestDependency
and wire up shared Azure Core source files in the Namespaces project - Remove a codegen suppression attribute that may no longer be necessary
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src/properties/AssemblyInfo.cs | Removed CodeGenSuppressType entry |
sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src/Azure.Messaging.EventGrid.Namespaces.csproj | Added IncludeAutorestDependency toggle and shared core includes |
eng/Directory.Build.Common.targets | Switched AutoRest package condition and added GenerateCode target |
eng/Directory.Build.Common.props | Defaulted IncludeAutorestDependency for client libraries |
Comments suppressed due to low confidence (3)
sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src/properties/AssemblyInfo.cs:10
- Removing this
CodeGenSuppressType
attribute may re-enable generation for a type that was intentionally suppressed. Confirm whether this suppression is obsolete or if it needs to be relocated/updated in the code-gen configuration.
-[assembly: CodeGenSuppressType("MessagingEventGridNamespacesClientBuilderExtensions")]
eng/Directory.Build.Common.targets:454
- [nitpick] The error message is a bit verbose and references internal property names. Consider simplifying to something like: "Temporary TypeSpec inputs missing; run
dotnet build /t:GenerateCode /p:SaveInputs=true
once without SkipSync."
<Error Text="You used skipped sync but didn't have the TempTypeSpecFiles in your project directory. Please run 'dotnet build /t:GenerateCode /p:SaveInputs=true' without SkipSync first at least once" Condition="'$(SkipSync)' == 'true' AND !Exists('$(MSBuildProjectDirectory)/../TempTypeSpecFiles')" />
eng/Directory.Build.Common.targets:453
- [nitpick] The new
GenerateCode
MSBuild target adds important code-gen behavior. Consider adding automated CI tests or integration steps to validate this target under various flags (SkipSync
,SaveInputs
, presence ofTypeSpecInput
).
<Target Name="GenerateCode" Condition="'$(IncludeAutorestDependency)' != 'true' AND '$(TypeSpecInput)' != ''">
...entgrid/Azure.Messaging.EventGrid.Namespaces/src/Azure.Messaging.EventGrid.Namespaces.csproj
Show resolved
Hide resolved
This reverts commit af7c6e1.
This reverts commit af7c6e1.
Fixes #49545