Skip to content

Commit

Permalink
fix: the source generator not detecting lazy correctly (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson authored Nov 4, 2021
1 parent afd3cd1 commit 47b24ce
Show file tree
Hide file tree
Showing 154 changed files with 270 additions and 260 deletions.
18 changes: 6 additions & 12 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -16,7 +17,6 @@
<PackageReleaseNotes>https://github.com/reactivemarbles/Locator/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/reactivemarbles/Locator</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
Expand All @@ -25,30 +25,24 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\"/>
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.240" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.244" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.354" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="3.2.2" PrivateAssets="All" />
Expand All @@ -57,4 +51,4 @@
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -21,8 +21,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Verify.SourceGenerators" Version="1.2.0" />
<PackageReference Include="Verify.Xunit" Version="13.1.0" />
<PackageReference Include="ReactiveMarbles.SourceGenerator.TestNuGetHelper" Version="1.1.1" />
<PackageReference Include="Verify.Xunit" Version="14.1.1" />
<PackageReference Include="ReactiveMarbles.SourceGenerator.TestNuGetHelper" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (26,36)-(26,44),
Location: Unknown File: (26,36)-(26,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand All @@ -15,7 +15,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (18,36)-(18,44),
Location: Unknown File: (18,36)-(18,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (26,36)-(26,44),
Location: Unknown File: (26,36)-(26,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand All @@ -15,7 +15,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (18,36)-(18,44),
Location: Unknown File: (18,36)-(18,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (26,36)-(26,44),
Location: Unknown File: (26,36)-(26,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand All @@ -15,7 +15,7 @@
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (18,36)-(18,44),
Location: Unknown File: (18,36)-(18,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} );
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
resolver.AddLazySingleton<global::Test.TestConcrete>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} );
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} );
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty=(global::Test.IServiceProperty)resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty = resolver.GetService<global::Test.IServiceProperty>()} , "Test2");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty1=(global::Test.IServiceProperty1)resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2=(global::Test.IServiceProperty2)resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3=(global::Test.IServiceProperty3)resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty1 = resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2 = resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3 = resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty1=(global::Test.IServiceProperty1)resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2=(global::Test.IServiceProperty2)resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3=(global::Test.IServiceProperty3)resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty1 = resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2 = resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3 = resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
static partial void SetupIOCInternal(ReactiveMarbles.Locator.IServiceLocator resolver)
{
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService<global::Test.IService1>(), (global::Test.IService2)resolver.GetService<global::Test.IService2>()){ ServiceProperty1=(global::Test.IServiceProperty1)resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2=(global::Test.IServiceProperty2)resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3=(global::Test.IServiceProperty3)resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
resolver.AddLazySingleton<global::Test.ITest>(() => new global::Test.TestConcrete(resolver.GetService<global::Test.IService1>(), resolver.GetService<global::Test.IService2>()){ ServiceProperty1 = resolver.GetService<global::Test.IServiceProperty1>(), ServiceProperty2 = resolver.GetService<global::Test.IServiceProperty2>(), ServiceProperty3 = resolver.GetService<global::Test.IServiceProperty3>()} , "Test1");
}
}
}
Loading

0 comments on commit 47b24ce

Please sign in to comment.