Skip to main content

RSCG_NameGenerator by Andrei Ignat

NuGet / site data

Nuget GitHub last commit GitHub Repo stars

Details

Info

info

Name: RSCG_NameGenerator

Generates uniqe names for release

Author: Andrei Ignat

NuGet: https://www.nuget.org/packages/RSCG_NameGenerator/

You can find more details at https://github.com/ignatandrei/NameGenerator/

Source: https://github.com/ignatandrei/NameGenerator/

Original Readme

note

NameGenerator

Generator of names for an assembly / product release . Generates names for {adjective}-{name} or {adjective-name-city}

The fact that is a Roslyn Code Generator ensures that you can use it in your projects without any additional dependencies - and get rid of him !

Usage

Add to the .csproj file:

  <ItemGroup>
<PackageReference Include="RSCG_NameGenerator" Version="2024.26.8.2002" >
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</PackageReference>
</ItemGroup>
<!-- optional -->
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

Then, in the code, you can use the following code:

using Generated.TestNameGenerator;
//by just putting here
//you will not deploy the dll when you deploy the project
//name are generated in the code source
Console.WriteLine($"Name:{TheAssemblyInfo.GeneratedName}");
Console.WriteLine($"Nice:{TheAssemblyInfo.GeneratedNameNice}");
Console.WriteLine($"Small:{TheAssemblyInfo.GeneratedNameSmall}");

More examples

Please see https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG for a list of examples of Roslyn Source Code Generators

Enjoy!

About

note

Generating unique names for assemblies

How to use

Example (source csproj, source files)

This is the CSharp Project that references RSCG_NameGenerator

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RSCG_NameGenerator" Version="2024.26.8.2002" >
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
</Project>

Generated Files

Those are taken from $(BaseIntermediateOutputPath)\GX


// <auto-generated/>
namespace Generated.TestNameGenerator
{
public static class TheAssemblyInfo
{
public const string AssemblyName = "TestNameGenerator";
public const string GeneratedNameNice = "Henri Bergson is feeling clear in Dhaka";
public const string GeneratedNameSmall = "clear-Henri Bergson";
public const string GeneratedName = "clear-Henri Bergson-Dhaka";

}
}

Useful

Download Example (.NET C#)

Share RSCG_NameGenerator

https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_NameGenerator

aaa

Category "EnhancementProject" has the following generators:

1 AssemblyVersionInfo

2 AutoInvoke.Generator

3 AutoSpectre

4 BuildInfo

5 CommandLine

6 Credfeto.Version.Information.Generator

7 Larcanum.GitInfo

8 LinqGen.Generator

9 Pekspro.BuildInformationGenerator

10 PlantUmlClassDiagramGenerator

11 RSCG_AMS

12 RSCG_ExportDiagram

13 RSCG_FunctionsWithDI

14 RSCG_NameGenerator

15 RSCG_TimeBombComment

16 RSCG_Wait

17 ShadowWriterProjectInfo

18 ThisAssembly

19 ThisAssembly.Constants

20 ThisAssembly.Metadata

See category

EnhancementProject