Skip to content

Commit

Permalink
Removed metapackage. Made it one single nuget package with abstractio…
Browse files Browse the repository at this point in the history
…ns lib and generator included. rc5
  • Loading branch information
dombrovsky committed Oct 8, 2024
1 parent 7b120d0 commit cd2244d
Show file tree
Hide file tree
Showing 22 changed files with 127 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<PropertyGroup>
<Version>1.0.0-rc4</Version>
<Version>1.0.0-rc5</Version>
<Authors>Volodymyr Dombrovskyi</Authors>
<Copyright>Copyright (c) 2024 Volodymyr Dombrovskyi</Copyright>
<RepositoryUrl>https://github.com/dombrovsky/StrongTypeIdGenerator.git</RepositoryUrl>
Expand Down
7 changes: 5 additions & 2 deletions StrongTypeIdGenerator.Abstractions/ITypedIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ public interface ITypedIdentifier<out TIdentifier>
{
TIdentifier Value { get; }
}

#if NET7_0_OR_GREATER
public interface ITypedIdentifier<TSelf, TIdentifier> :
ITypedIdentifier<TIdentifier>,
#else
public interface ITypedIdentifier<TSelf, out TIdentifier> :
#endif
ITypedIdentifier<TIdentifier>,
IEquatable<TSelf>,
IComparable<TSelf>,
IFormattable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>StrongTypeIdGenerator</RootNamespace>
<PackageId>StrongTypeIdGenerator.Abstractions</PackageId>
<PackageId>StrongTypeIdGenerator</PackageId>
<IsPackable>true</IsPackable>

<PackageTags>string-id,guid-id,strong-typed-id,strongly-typed,identifier,source-generator,generator</PackageTags>
<Description>
StrongTypeIdGenerator is a source generator that helps you create strongly-typed identifiers in your C# projects. It supports Guid and string-based identifiers.

This package contains attributes and base types used by generated id types.
</Description>
</PropertyGroup>

Expand All @@ -19,4 +17,16 @@
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StrongTypeIdGenerator.SourceGenerator\StrongTypeIdGenerator.SourceGenerator.csproj" Pack="false">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<None Include="$(OutputPath)\netstandard2.0\StrongTypeIdGenerator.SourceGenerator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace StrongTypeIdGenerator.Tests
namespace StrongTypeIdGenerator.Json.Tests
{
using StrongTypeIdGenerator.Tests;

internal sealed class GuidIdSystemTextJsonConversionFixture : SystemTextJsonConversionFixture<TestGuidId, Guid>
{
protected override Guid GetValue()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace StrongTypeIdGenerator.Tests
namespace StrongTypeIdGenerator.Json.Tests
{
using StrongTypeIdGenerator.Tests;

internal sealed class StringIdSystemTextJsonConversionFixture : SystemTextJsonConversionFixture<TestStringId, string>
{
protected override string GetValue()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.8;net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Polyfill" Version="1.29.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StrongTypeIdGenerator.Abstractions\StrongTypeIdGenerator.Abstractions.csproj" />
<ProjectReference Include="..\StrongTypeIdGenerator.Json\StrongTypeIdGenerator.Json.csproj" />
<ProjectReference Include="..\StrongTypeIdGenerator.Tests.IdTypes\StrongTypeIdGenerator.Tests.IdTypes.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StrongTypeIdGenerator.Tests
namespace StrongTypeIdGenerator.Json.Tests
{
using StrongTypeIdGenerator.Json;
using System.Text.Json;
Expand Down

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
<IsRoslynComponent>true</IsRoslynComponent>
<IsPackable>true</IsPackable>
<IsPackable>false</IsPackable>
<PackageId>StrongTypeIdGenerator.SourceGenerator</PackageId>
<PackageTags>string-id,guid-id,strong-typed-id,strongly-typed,identifier,source-generator,generator</PackageTags>
<Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace StrongTypeIdGenerator.Tests
{
[GuidId]
internal partial class CheckValueGuidId
public partial class CheckValueGuidId
{
public static readonly Guid InvalidValue = Guid.Parse("90BC12B3-F9FA-44FF-AEEF-D30688D9B1FC");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace StrongTypeIdGenerator.Tests
{
[StringId]
internal partial class CheckValueStringId
public partial class CheckValueStringId
{
private static string CheckValue(string value)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace StrongTypeIdGenerator.Tests
{
internal partial class DerivedTestGuidId : TestGuidId
public partial class DerivedTestGuidId : TestGuidId
{
public DerivedTestGuidId(Guid id) : base(id)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace StrongTypeIdGenerator.Tests
{
internal sealed partial class DerivedTestStringId : TestStringId
public sealed partial class DerivedTestStringId : TestStringId
{
public DerivedTestStringId(string value)
: base(value)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.8;net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Polyfill" Version="1.29.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StrongTypeIdGenerator.Abstractions\StrongTypeIdGenerator.Abstractions.csproj" />
<ProjectReference Include="..\StrongTypeIdGenerator.SourceGenerator\StrongTypeIdGenerator.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace StrongTypeIdGenerator.Tests
{
[GuidId]
internal partial class TestGuidId
public partial class TestGuidId
{
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace StrongTypeIdGenerator.Tests
{
[StringId]
internal partial class TestStringId
public partial class TestStringId
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net4.8\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StrongTypeIdGenerator.Abstractions\StrongTypeIdGenerator.Abstractions.csproj" />
<ProjectReference Include="..\StrongTypeIdGenerator.Json\StrongTypeIdGenerator.Json.csproj" />
<ProjectReference Include="..\StrongTypeIdGenerator\StrongTypeIdGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StrongTypeIdGenerator.Tests.IdTypes\StrongTypeIdGenerator.Tests.IdTypes.csproj" />
</ItemGroup>

</Project>
35 changes: 24 additions & 11 deletions StrongTypeIdGenerator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongTypeIdGenerator", "StrongTypeIdGenerator\StrongTypeIdGenerator.csproj", "{F8986E9E-3E63-4CE8-B214-327FB918F6DA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongTypeIdGenerator.Tests", "StrongTypeIdGenerator.Tests\StrongTypeIdGenerator.Tests.csproj", "{F44CA131-E9DC-4B7F-A775-94F9041B69FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongTypeIdGenerator.Abstractions", "StrongTypeIdGenerator.Abstractions\StrongTypeIdGenerator.Abstractions.csproj", "{D6F45F02-A86A-4336-8CA1-273C0163CA55}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongTypeIdGenerator.Json", "StrongTypeIdGenerator.Json\StrongTypeIdGenerator.Json.csproj", "{C05022B2-BE8F-45E1-8783-D738E1995E1D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StrongTypeIdGenerator.MetaPackage", "StrongTypeIdGenerator.MetaPackage\StrongTypeIdGenerator.MetaPackage.csproj", "{371E81D4-0FB7-4479-A381-C58F3ACD9C91}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StrongTypeIdGenerator.Tests.IdTypes", "StrongTypeIdGenerator.Tests.IdTypes\StrongTypeIdGenerator.Tests.IdTypes.csproj", "{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StrongTypeIdGenerator.Json.Tests", "StrongTypeIdGenerator.Json.Tests\StrongTypeIdGenerator.Json.Tests.csproj", "{998E1F59-3A9B-4A8C-A370-55EFEC2210D3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AA16F88E-B22D-46F5-AD78-E816982B3619}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongTypeIdGenerator.SourceGenerator", "StrongTypeIdGenerator.SourceGenerator\StrongTypeIdGenerator.SourceGenerator.csproj", "{5787B4E7-1788-4E6B-B6C1-C35B4753F6EA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8986E9E-3E63-4CE8-B214-327FB918F6DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8986E9E-3E63-4CE8-B214-327FB918F6DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8986E9E-3E63-4CE8-B214-327FB918F6DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8986E9E-3E63-4CE8-B214-327FB918F6DA}.Release|Any CPU.Build.0 = Release|Any CPU
{F44CA131-E9DC-4B7F-A775-94F9041B69FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F44CA131-E9DC-4B7F-A775-94F9041B69FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F44CA131-E9DC-4B7F-A775-94F9041B69FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -43,14 +43,27 @@ Global
{C05022B2-BE8F-45E1-8783-D738E1995E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C05022B2-BE8F-45E1-8783-D738E1995E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C05022B2-BE8F-45E1-8783-D738E1995E1D}.Release|Any CPU.Build.0 = Release|Any CPU
{371E81D4-0FB7-4479-A381-C58F3ACD9C91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{371E81D4-0FB7-4479-A381-C58F3ACD9C91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{371E81D4-0FB7-4479-A381-C58F3ACD9C91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{371E81D4-0FB7-4479-A381-C58F3ACD9C91}.Release|Any CPU.Build.0 = Release|Any CPU
{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD}.Release|Any CPU.Build.0 = Release|Any CPU
{998E1F59-3A9B-4A8C-A370-55EFEC2210D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{998E1F59-3A9B-4A8C-A370-55EFEC2210D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{998E1F59-3A9B-4A8C-A370-55EFEC2210D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{998E1F59-3A9B-4A8C-A370-55EFEC2210D3}.Release|Any CPU.Build.0 = Release|Any CPU
{5787B4E7-1788-4E6B-B6C1-C35B4753F6EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5787B4E7-1788-4E6B-B6C1-C35B4753F6EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5787B4E7-1788-4E6B-B6C1-C35B4753F6EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5787B4E7-1788-4E6B-B6C1-C35B4753F6EA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F44CA131-E9DC-4B7F-A775-94F9041B69FC} = {AA16F88E-B22D-46F5-AD78-E816982B3619}
{8EF5AAF0-0AB3-408C-90D0-53BD767AD4AD} = {AA16F88E-B22D-46F5-AD78-E816982B3619}
{998E1F59-3A9B-4A8C-A370-55EFEC2210D3} = {AA16F88E-B22D-46F5-AD78-E816982B3619}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8A1DBD56-6EB3-485A-8632-B6A8E154B068}
EndGlobalSection
Expand Down

0 comments on commit cd2244d

Please sign in to comment.