Skip to content
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

build(sdk): add analyzer in the build process of mgmt track2 sdks #3488

Closed
archerzz opened this issue Jun 9, 2023 · 1 comment
Closed

build(sdk): add analyzer in the build process of mgmt track2 sdks #3488

archerzz opened this issue Jun 9, 2023 · 1 comment
Assignees
Labels
Mgmt This issue is related to a management-plane library. Mgmt-EngSys Engineering System (Management Plane Specific)

Comments

@archerzz
Copy link
Member

archerzz commented Jun 9, 2023

Description

As an SDK developer, I'd like to enable mgmt track2 analyzer in the build process.

Solution

Solution 1: Add analyzer as a separate package

  • Publish mgmt track2 analyzers to nuget package Azure.MgmtSdk.Analyzers
  • Enable it only for mgmt track2 SDK, like:
<PackageReference Condition="'$(EnableMgmtTrack2SdkAnalyzers)' == 'true'" Include="Azure.MgmtSdk.Analyzers" PrivateAssets="All" />

Solution 2: Add analyzer into existing package Azure.ClientSdk.Analyzers

  • add analyzer rules into Azure.ClientSdk.Analyzers
  • mgmt analyzer rules are enable only when an environment property is set, like:
<IsMgmtLibrary Condition="'$(IsMgmtLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.ResourceManager'))">true</IsMgmtLibrary>
@archerzz archerzz added Mgmt This issue is related to a management-plane library. Mgmt-EngSys Engineering System (Management Plane Specific) labels Jun 9, 2023
@archerzz archerzz self-assigned this Jun 9, 2023
archerzz added a commit to archerzz/azure-sdk-for-net that referenced this issue Aug 1, 2023
- proposed way to change eng props to add mgmt sdk analyzers
- add a example of how to suppress warning

Azure/autorest.csharp#3486
Azure/autorest.csharp#3488
@archerzz
Copy link
Member Author

Close since the work item has been resolved in Azure/azure-sdk-tools#6905

We choose solution 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt This issue is related to a management-plane library. Mgmt-EngSys Engineering System (Management Plane Specific)
Projects
None yet
Development

No branches or pull requests

1 participant