Prepared NuGet distribution

This commit is contained in:
Thorsten Sommer 2024-05-05 13:19:54 +02:00
parent e07c57e640
commit 07ffe92067
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
7 changed files with 70 additions and 0 deletions

View File

@ -7,6 +7,19 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors> <WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules> <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeBuildOutput>false</IncludeBuildOutput> <!-- Do not include build output in the package. Necessary for analyzers. -->
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<PackageVersion>1.0.0</PackageVersion>
<Authors>Thorsten Sommer</Authors>
<PackageProjectUrl>https://devops.tsommer.org/open-source/dotnet/csv-metrics-logger</PackageProjectUrl>
<RepositoryUrl>https://devops.tsommer.org/open-source/dotnet/csv-metrics-logger</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyName>CSVMetricsLoggerGenerator</AssemblyName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -17,4 +30,13 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1 @@
TODO

View File

@ -7,10 +7,33 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors> <WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<PackageVersion>1.0.0</PackageVersion>
<Authors>Thorsten Sommer</Authors>
<PackageProjectUrl>https://devops.tsommer.org/open-source/dotnet/csv-metrics-logger</PackageProjectUrl>
<RepositoryUrl>https://devops.tsommer.org/open-source/dotnet/csv-metrics-logger</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyName>CSVMetricsLogger</AssemblyName>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CSV Metrics Logger Generator\CSV Metrics Logger Generator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> <ProjectReference Include="..\CSV Metrics Logger Generator\CSV Metrics Logger Generator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DocumentationFile>bin\Debug\CSVMetricsLogger.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\Release\CSVMetricsLogger.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,9 @@
namespace CSV_Metrics_Logger; namespace CSV_Metrics_Logger;
/// <summary>
/// An attribute to mark a struct as a CSV record. Every so marked struct
/// will be augmented with the necessary methods to convert it to a CSV record.
/// In order to work, the struct must be partial.
/// </summary>
[AttributeUsage(AttributeTargets.Struct)] [AttributeUsage(AttributeTargets.Struct)]
public sealed class CSVRecordAttribute : Attribute; public sealed class CSVRecordAttribute : Attribute;

View File

@ -1,10 +1,27 @@
namespace CSV_Metrics_Logger; namespace CSV_Metrics_Logger;
/// <summary>
/// Interface for converting a struct to a CSV record. This interface is used
/// by the source generator to augment the struct with the necessary methods.
/// Hence, you DO NOT need to implement this interface yourself.
/// </summary>
public interface IConvertToCSV public interface IConvertToCSV
{ {
/// <summary>
/// Returns the number of columns in the CSV record.
/// </summary>
/// <returns>The number of columns in the CSV record.</returns>
public uint GetCSVColumnCount(); public uint GetCSVColumnCount();
/// <summary>
/// Returns the headers of the CSV record.
/// </summary>
/// <returns>The headers of the CSV record.</returns>
public IList<string> GetCSVHeaders(); public IList<string> GetCSVHeaders();
/// <summary>
/// Returns the data line of the CSV record.
/// </summary>
/// <returns>The data line of the CSV record.</returns>
public IList<string> ConvertToCSVDataLine(); public IList<string> ConvertToCSVDataLine();
} }

View File

@ -0,0 +1 @@
TODO

View File

@ -0,0 +1 @@
TODO