Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Dec 6, 2024

The customization of the class and namespace for the AddServices method added non-trivial complexity to the whole process.

Here we simplify it in two ways:

1 - In non-editor usage, the files are simply added as Compile, no need to process them
2 - In editor usage, we don't include them since we emit the [Obsolete] warning as needed.

This means we only need to do the additional file inclusion when building in the editor, which should minimize the impact of our generators on CI/CLI even more.

@kzu kzu added the enhancement New feature or request label Dec 6, 2024
The customization of the class and namespace for the `AddServices` method added non-trivial complexity to the whole process.

Here we simplify it in two ways:

1 - In non-editor usage, the files are simply added as Compile, no need to process them
2 - In editor usage, we don't include them since we emit the [Obsolete] warning as needed.

This means we only need to do the additional file inclusion when building in the editor, which should minimize the impact of our generators on CI/CLI even more.
@devlooped-bot
Copy link
Member

devlooped-bot commented Dec 6, 2024

35 passed 35 passed

🧪 Details on Ubuntu 22.04.5 LTS

✅ Tests.CodeAnalysis.AddServicesAnalyzerTests.NoWarningIfAddServicesPresent
✅ Tests.CodeAnalysis.AddServicesAnalyzerTests.NoWarningIfNoServiceCollectionCalls
✅ Tests.CodeAnalysis.AddServicesAnalyzerTests.WarnIfAddServicesMissing
✅ Tests.CodeAnalysis.AddServicesAnalyzerTests.WarnIfAddServicesMissingMultipleLocations
✅ Tests.CodeAnalysis.ConventionAnalyzerTests.ErrorIfNonTypeOf
✅ Tests.CodeAnalysis.ConventionAnalyzerTests.NoErrorOnTypeOfAndLifetime
✅ Tests.CodeAnalysis.ConventionAnalyzerTests.WarnIfOpenGeneric
✅ Tests.ComponentModel.ComponentModelTests.Composition
✅ Tests.ComponentModel.ComponentModelTests.RegisterSingletonService
✅ Tests.ComponentModel.ComponentModelTests.RegisterTransientService
✅ Tests.ComponentModel.ComponentModelTests.ResolvesDependency
✅ Tests.Composition.CompositionTests.CompositionLifetimes
✅ Tests.Composition.CompositionTests.RegisterKeyedService
✅ Tests.Composition.CompositionTests.RegisterSingletonService
✅ Tests.Composition.CompositionTests.RegisterTransientService
✅ Tests.Composition.CompositionTests.ResolvesDependency
✅ Tests.DependencyInjection.ConventionsTests.RegisterGenericServices
✅ Tests.DependencyInjection.ConventionsTests.RegisterRepositoryServices
✅ Tests.DependencyInjection.ConventionsTests.RegisterServiceByRegex
✅ Tests.DependencyInjection.GenerationTests.RegisterInternalService
✅ Tests.DependencyInjection.GenerationTests.RegisterKeyedScopedService
✅ Tests.DependencyInjection.GenerationTests.RegisterKeyedSingletonService
✅ Tests.DependencyInjection.GenerationTests.RegisterKeyedTransientService
✅ Tests.DependencyInjection.GenerationTests.RegisterScopedService
✅ Tests.DependencyInjection.GenerationTests.RegisterSingletonService
✅ Tests.DependencyInjection.GenerationTests.RegisterTransientService
✅ Tests.DependencyInjection.GenerationTests.RegisterWithCustomServiceAttribute
✅ Tests.DependencyInjection.GenerationTests.RegisterWithGenericOutParameterHierarchy
✅ Tests.DependencyInjection.GenerationTests.ResolveMultipleKeys
✅ Tests.DependencyInjection.GenerationTests.ResolvesDependency
✅ Tests.DependencyInjection.GenerationTests.ResolvesKeyedDependency
✅ Tests.DependencyInjection.GenerationTests.ResolvesKeyedDependencyForNonKeyed
✅ Tests.DependencyInjection.GenerationTests.ResolvesKeyedFromContracts
✅ Tests.DependencyInjection.GenerationTests.ResolvesKeyedTransientDependency
✅ Tests.DependencyInjection.GenerationTests.RetrieveMany

from dotnet-retest v0.6.3 on .NET 8.0.11 with 💜

@kzu kzu enabled auto-merge (rebase) December 6, 2024 18:22
@kzu kzu merged commit 4db4b1b into main Dec 6, 2024
7 checks passed
@kzu kzu deleted the dev/simplify branch December 6, 2024 18:23
@devlooped devlooped locked and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants