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 = "Isaac Bashevis Singer is feeling present in Manila";
public const string GeneratedNameSmall = "present-Isaac Bashevis Singer";
public const string GeneratedName = "present-Isaac Bashevis Singer-Manila";

}
}

Usefull

Download Example (.NET C# )

Share RSCG_NameGenerator

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

In the same category (EnhancementProject) - 16 other generators

AutoInvoke.Generator

AutoSpectre

BuildInfo

Com

CommandLine

LinqGen.Generator

Pekspro.BuildInformationGenerator

PlantUmlClassDiagramGenerator

RSCG_AMS

RSCG_ExportDiagram

RSCG_FunctionsWithDI

RSCG_TimeBombComment

RSCG_Wait

ThisAssembly

ThisAssembly.Constants

ThisAssembly.Metadata