Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions DependencyInjection.Attributed.sln → DependencyInjection.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.32916.344
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Attributed", "src\DependencyInjection.Attributed\Attributed.csproj", "{9DF192DF-0330-4B82-81C5-B8E7B4D53E41}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjection", "src\DependencyInjection\DependencyInjection.csproj", "{9DF192DF-0330-4B82-81C5-B8E7B4D53E41}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Attributed.Tests", "src\DependencyInjection.Attributed.Tests\Attributed.Tests.csproj", "{F2E67084-FED3-4E17-A012-0E8948FD3E06}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjection.Tests", "src\DependencyInjection.Tests\DependencyInjection.Tests.csproj", "{F2E67084-FED3-4E17-A012-0E8948FD3E06}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeAnalysis.Tests", "src\CodeAnalysis.Tests\CodeAnalysis.Tests.csproj", "{E512DEBA-FB35-47FD-AF25-3BAECCF667B1}"
EndProject
Expand All @@ -17,6 +17,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library2", "src\Samples\Lib
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "src\Samples\ConsoleApp\ConsoleApp.csproj", "{26EF99DB-D846-4F65-929D-D7E3E820423A}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Attributed", "src\Attributed\Attributed.msbuildproj", "{1E68517F-34E7-415E-91B1-857802ED5592}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -47,6 +49,10 @@ Global
{26EF99DB-D846-4F65-929D-D7E3E820423A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26EF99DB-D846-4F65-929D-D7E3E820423A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26EF99DB-D846-4F65-929D-D7E3E820423A}.Release|Any CPU.Build.0 = Release|Any CPU
{1E68517F-34E7-415E-91B1-857802ED5592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E68517F-34E7-415E-91B1-857802ED5592}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E68517F-34E7-415E-91B1-857802ED5592}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E68517F-34E7-415E-91B1-857802ED5592}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
18 changes: 18 additions & 0 deletions src/Attributed/Attributed.msbuildproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.Build.NoTargets/3.5.0" TreatAsLocalProperty="Version">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>Devlooped.Extensions.DependencyInjection.Attributed</PackageId>
<Description>Superseded by Devlooped.Extensions.DependencyInjection</Description>
<Version>2.1.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DependencyInjection\DependencyInjection.csproj" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/Attributed/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Obsolete

This package now just references [Devlooped.Extensions.DependencyInjection](http://nuget.org/packages/Devlooped.Extensions.DependencyInjection)
which contains all its functionality and more.
6 changes: 3 additions & 3 deletions src/CodeAnalysis.Tests/AddServicesAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Devlooped.Extensions.DependencyInjection.Attributed;
using Devlooped.Extensions.DependencyInjection;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using Xunit;
using Xunit.Abstractions;
using AnalyzerTest = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerTest<Devlooped.Extensions.DependencyInjection.Attributed.AddServicesAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using Verifier = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Devlooped.Extensions.DependencyInjection.Attributed.AddServicesAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using AnalyzerTest = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerTest<Devlooped.Extensions.DependencyInjection.AddServicesAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using Verifier = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Devlooped.Extensions.DependencyInjection.AddServicesAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;

namespace Tests.CodeAnalysis;

Expand Down
4 changes: 2 additions & 2 deletions src/CodeAnalysis.Tests/CodeAnalysis.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DependencyInjection.Attributed\Attributed.csproj" />
<ProjectReference Include="..\DependencyInjection\DependencyInjection.csproj" />
</ItemGroup>

<Import Project="..\DependencyInjection.Attributed.Tests\ContentFiles.targets" />
<Import Project="..\DependencyInjection.Tests\ContentFiles.targets" />

</Project>
6 changes: 3 additions & 3 deletions src/CodeAnalysis.Tests/ConventionAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Devlooped.Extensions.DependencyInjection.Attributed;
using Devlooped.Extensions.DependencyInjection;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using Xunit;
using Xunit.Abstractions;
using AnalyzerTest = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerTest<Devlooped.Extensions.DependencyInjection.Attributed.ConventionsAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using Verifier = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Devlooped.Extensions.DependencyInjection.Attributed.ConventionsAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using AnalyzerTest = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerTest<Devlooped.Extensions.DependencyInjection.ConventionsAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
using Verifier = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Devlooped.Extensions.DependencyInjection.ConventionsAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;

namespace Tests.CodeAnalysis;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<!-- Simulates including the files under contentFiles/cs/netstandard2.0 in the final package -->

<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\AttributedServicesExtension.cs" Link="AttributedServicesExtension.cs" Visible="false" />
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\ServiceAttribute.cs" Link="ServiceAttribute.cs" Visible="false" />
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\ServiceAttribute`1.cs" Link="ServiceAttribute`1.cs" Visible="false" />
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection\AttributedServicesExtension.cs" Link="AttributedServicesExtension.cs" Visible="false" />
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection\ServiceAttribute.cs" Link="ServiceAttribute.cs" Visible="false" />
<Compile Include="$(MSBuildThisFileDirectory)..\DependencyInjection\ServiceAttribute`1.cs" Link="ServiceAttribute`1.cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\AttributedServicesExtension.cs" Type="Non-Resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\ServiceAttribute.cs" Type="Non-Resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection.Attributed\ServiceAttribute`1.cs" Type="Non-Resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection\AttributedServicesExtension.cs" Type="Non-Resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection\ServiceAttribute.cs" Type="Non-Resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)..\DependencyInjection\ServiceAttribute`1.cs" Type="Non-Resx" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.props" />
<Import Project="..\DependencyInjection\Devlooped.Extensions.DependencyInjection.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<RootNamespace>Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Remove="ComponentModelTests.cs" />
<Compile Remove="CompositionTests.cs" />
<Compile Remove="GenerationTests.cs" />
</ItemGroup>

<ItemGroup>
<None Include="ComponentModelTests.cs" />
<None Include="CompositionTests.cs" />
<None Include="GenerationTests.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
Expand All @@ -32,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DependencyInjection.Attributed\Attributed.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\DependencyInjection\DependencyInjection.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>

<ItemGroup>
Expand All @@ -41,6 +29,6 @@
</ItemGroup>

<Import Project="ContentFiles.targets" />
<Import Project="..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.targets" />
<Import Project="..\DependencyInjection\Devlooped.Extensions.DependencyInjection.targets" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Devlooped.Extensions.DependencyInjection.Attributed;
namespace Devlooped.Extensions.DependencyInjection;

[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public class AddServicesAnalyzer : DiagnosticAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Devlooped.Extensions.DependencyInjection.Attributed;
namespace Devlooped.Extensions.DependencyInjection;

[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public class ConventionsAnalyzer : DiagnosticAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<LangVersion>Preview</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Devlooped.Extensions.DependencyInjection.Attributed</AssemblyName>
<PackageId>Devlooped.Extensions.DependencyInjection.Attributed</PackageId>
<AssemblyName>Devlooped.Extensions.DependencyInjection</AssemblyName>
<PackageId>Devlooped.Extensions.DependencyInjection</PackageId>
<Title>Automatic compile-time service registrations for Microsoft.Extensions.DependencyInjection with no run-time dependencies.</Title>
<Description>$(Title)</Description>
<PackFolder>analyzers/dotnet</PackFolder>
Expand All @@ -23,8 +23,8 @@
</ItemGroup>

<ItemGroup>
<None Update="Devlooped.Extensions.DependencyInjection.Attributed.props" CopyToOutputDirectory="PreserveNewest" PackFolder="buildTransitive" />
<None Update="Devlooped.Extensions.DependencyInjection.Attributed.targets" CopyToOutputDirectory="PreserveNewest" PackFolder="buildTransitive" />
<None Update="Devlooped.Extensions.DependencyInjection.props" CopyToOutputDirectory="PreserveNewest" PackFolder="buildTransitive" />
<None Update="Devlooped.Extensions.DependencyInjection.targets" CopyToOutputDirectory="PreserveNewest" PackFolder="buildTransitive" />
<Compile Update="AttributedServicesExtension.cs" Pack="true" />
<Compile Update="ServiceAttribute*.cs" Pack="true" />
</ItemGroup>
Expand All @@ -36,8 +36,8 @@
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
</ItemGroup>

<Target Name="PokePackageVersion" BeforeTargets="GetPackageContents" DependsOnTargets="CopyFilesToOutputDirectory" Condition="'$(dotnet-nugetize)' == '' and Exists('$(OutputPath)\Devlooped.Extensions.DependencyInjection.Attributed.props')">
<XmlPoke XmlInputPath="$(OutputPath)\Devlooped.Extensions.DependencyInjection.Attributed.props" Query="/Project/PropertyGroup/DevloopedExtensionsDependencyInjectionVersion" Value="$(PackageVersion)" />
<Target Name="PokePackageVersion" BeforeTargets="GetPackageContents" DependsOnTargets="CopyFilesToOutputDirectory" Condition="'$(dotnet-nugetize)' == '' and Exists('$(OutputPath)\Devlooped.Extensions.DependencyInjection.props')">
<XmlPoke XmlInputPath="$(OutputPath)\Devlooped.Extensions.DependencyInjection.props" Query="/Project/PropertyGroup/DevloopedExtensionsDependencyInjectionVersion" Value="$(PackageVersion)" />
</Target>

<UsingTask TaskName="XmlPoke" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Microsoft.CodeAnalysis.Diagnostics;
using KeyedService = (Microsoft.CodeAnalysis.INamedTypeSymbol Type, Microsoft.CodeAnalysis.TypedConstant? Key);

namespace Devlooped.Extensions.DependencyInjection.Attributed;
namespace Devlooped.Extensions.DependencyInjection;

/// <summary>
/// Discovers annotated services during compilation and generates the partial method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.CodeAnalysis;

namespace Devlooped.Extensions.DependencyInjection.Attributed;
namespace Devlooped.Extensions.DependencyInjection;

[Generator(LanguageNames.CSharp)]
public class StaticGenerator : ISourceGenerator
Expand All @@ -24,7 +24,7 @@ public void Execute(GeneratorExecutionContext context)
value : "AddServicesExtension";

context.AddSource("AddServicesExtension.g", ThisAssembly.Resources.AddServicesExtension.Text
.Replace("Devlooped.Extensions.DependencyInjection.Attributed", rootNs)
.Replace("Devlooped.Extensions.DependencyInjection", rootNs)
.Replace("AddServicesExtension", className));
}
}
8 changes: 4 additions & 4 deletions src/Samples/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.props" />
<Import Project="..\..\DependencyInjection\Devlooped.Extensions.DependencyInjection.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -17,9 +17,9 @@
<ItemGroup>
<ProjectReference Include="..\Library1\Library1.csproj" Aliases="Library1" />
<ProjectReference Include="..\Library2\Library2.csproj" Aliases="Library2" />
<ProjectReference Include="..\..\DependencyInjection.Attributed\Attributed.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\..\DependencyInjection\DependencyInjection.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>

<Import Project="..\..\DependencyInjection.Attributed.Tests\ContentFiles.targets" />
<Import Project="..\..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.props" />
<Import Project="..\..\DependencyInjection.Tests\ContentFiles.targets" />
<Import Project="..\..\DependencyInjection\Devlooped.Extensions.DependencyInjection.targets" />
</Project>
8 changes: 4 additions & 4 deletions src/Samples/Library1/Library1.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.props" />
<Import Project="..\..\DependencyInjection\Devlooped.Extensions.DependencyInjection.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -16,9 +16,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\DependencyInjection.Attributed\Attributed.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\..\DependencyInjection\DependencyInjection.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>

<Import Project="..\..\DependencyInjection.Attributed.Tests\ContentFiles.targets" />
<Import Project="..\..\DependencyInjection.Attributed\Devlooped.Extensions.DependencyInjection.Attributed.props" />
<Import Project="..\..\DependencyInjection.Tests\ContentFiles.targets" />
<Import Project="..\..\DependencyInjection\Devlooped.Extensions.DependencyInjection.props" />
</Project>