Skip to content

usausa/embedded-build-property

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BunnyTail.EmbeddedBuildProperty

NuGet

What is this?

Generate property to get build options.

Usage

Source

using BunnyTail.EmbeddedBuildProperty;

internal static partial class Variants
{
    [BuildProperty]
    public static partial string Flavor { get; }

    [BuildProperty("SecretKey")]
    public static partial string? Key { get; }
}

Build

dotnet build Example.csproj /p:EmbeddedBuildProperty=\"Flavor=Free,SecretKey=12345678\"

Result

Console.WriteLine($"Flavor: {Variants.Flavor}");    // Free
Console.WriteLine($"Key: {Variants.Key}");          // 12345678