Skip to content

Conversation

@MarcoRossignoli
Copy link
Contributor

@MarcoRossignoli MarcoRossignoli commented Aug 12, 2024

closes #3494

Available method with GenerateSelfRegisteredExtensions = true

c# extension method

SelfRegisteredExtensions.AddSelfRegisteredExtensions(builder, args);

vb extension method

SelfRegisteredExtensions.AddSelfRegisteredExtensions(builder, args)

For F# we need explicing namespace.

Microsoft.TestingPlatform.Extensions.SelfRegisteredExtensions.AddSelfRegisteredExtensions(builder, args)

cc: @bradwilson

Evangelink
Evangelink previously approved these changes Aug 12, 2024
Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

Looks like internal poll was more in favor of AddSelfRegisteredExtensions. One small nit and otherwise LGTM!

Thanks for taking over @MarcoRossignoli

…latformAutoRegisteredExtensions.cs

Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
@MarcoRossignoli
Copy link
Contributor Author

MarcoRossignoli commented Aug 12, 2024

Looks like internal poll was more in favor of AddSelfRegisteredExtensions. One small nit and otherwise LGTM!

I'll change the name

@bradwilson
Copy link

bradwilson commented Aug 12, 2024

I assume, to go along with this, all the existing extensions will be updated so that their ItemGroup registrations will be gated on GenerateAutoRegisteredExtensions?

Edit: Nevermind the above question, I see the condition was removed entirely in #3524. 👍🏼

I would set GenerateAutoRegisteredExtensions to true and GenerateTestingPlatformEntryPoint to false and I'd get just the registration function without Main, right?

Sounds good to me. 😄

@MarcoRossignoli
Copy link
Contributor Author

I would set GenerateAutoRegisteredExtensions to true and GenerateTestingPlatformEntryPoint to false and I'd get just the registration function without Main, right?

True

@engyebrahim helper with the other two issue too #3524 #3522

@MarcoRossignoli MarcoRossignoli marked this pull request as ready for review August 13, 2024 12:41
@MarcoRossignoli MarcoRossignoli merged commit 8ff51bb into microsoft:main Aug 13, 2024
@MarcoRossignoli MarcoRossignoli deleted the dev/mr/autorgisteredext branch August 13, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: MTP Extensions Area: MTP MSBuild Area: MTP Belongs to the Microsoft.Testing.Platform core library External: xUnit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Platform.MSBuild should allow generating a helper for registration of extensions

3 participants