Black.Beard.Build 1.0.135

There is a newer version of this package available.
See the version list below for details.
dotnet add package Black.Beard.Build --version 1.0.135
                    
NuGet\Install-Package Black.Beard.Build -Version 1.0.135
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Black.Beard.Build" Version="1.0.135" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Black.Beard.Build" Version="1.0.135" />
                    
Directory.Packages.props
<PackageReference Include="Black.Beard.Build" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Black.Beard.Build --version 1.0.135
                    
#r "nuget: Black.Beard.Build, 1.0.135"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Black.Beard.Build&version=1.0.135
                    
Install Black.Beard.Build as a Cake Addin
#tool nuget:?package=Black.Beard.Build&version=1.0.135
                    
Install Black.Beard.Build as a Cake Tool

Black.Beard.Roslyn

Build status

Helpers for compile Csharp with Roslyn. The way use the tool installed on your machine. It does'nt work if dotnet is not installed.

Sample the use Black.Beard.Build for create a csproj


    //Usings
    using Bb.Build;
    using System;
    using System.IO;

    // create a folder for store the generated project file
    var name = "Black.Beard.tests";
    var dir = new DirectoryInfo(Path.Combine(this._baseDirectory.FullName, name));

    var project = MsProjectsForBuild
                    .CreateProject((name, dir)        
                    .Sdk(ProjectSdk.MicrosoftNETSdk)    // Specify the target build

                    .SetPropertyGroup(c =>              // set the properies of the build
                    {
                        c.TargetFramework(TargetFramework.Net6)
                         .RootNamespace("Bb")
                         .Description("My description")
                         .RepositoryUrl(new System.Uri("http://github.com"))
                        ;
                    })

                    .Packages(p =>                      // Reference packages
                    {
                        p.PackageReference("Black.Beard.ComponentModel", new Version("1.0.36"))
                         .PackageReference("Black.Beard.Helpers.ContentLoaders", new Version("1.0.8"))
                        ;

                    });

    // Build
    var result = project.Build(inMemory: true, load: true);

    // fetch the new assembly
    var assembly = project.Assembly;

or the helper


    var project = MsProjects.CreateCsProject(dir.FullName, name, 
    TargetFramework.Net6, 
    "Bb"                
    )
    .SetPropertyGroup(a =>
    {
        a.Description("MyDescription");
    })
    .Packages(p =>
    {
        p.PackageReference("Black.Beard.ComponentModel", new Version("1.0.36"))
         .PackageReference("Black.Beard.Helpers.ContentLoaders", new Version("1.0.8"))
        ;
    
    });

This way use Roslyn for generate the assembly


    // Use NJsonSchema for generate json schema
    JsonSchema schema = JsonSchema.FromType(typeof(Sample1));

    // Helper for manipulate codeDom object
    var samples = "CodeDOMSample".ToNamespace()
        .Import("System")       // append usings

        .AppendPoco(schema)     // add a poco class from schema

        .ToCSharp(Path.Combine(_dir.FullName, "class1.cs")) // Generate csharp code
        ;

    // compile
    AssemblyResult assembly = GetCsharpBuilder(samples.FullName);

    // consumme the result assembly
    if (assembly.Success)
    {
        var ass = assembly.LoadAssembly();
        var type = ass.GetTypes().First(c => c.Name == "Sample1");
        Assert.NotNull(type);
    
        var property = type.GetProperties().FirstOrDefault(c => nameof(Sample1.Name) == c.Name);
        Assert.NotNull(property);
    
    }
    else
    {
        var payload = File.ReadAllText(samples.FullName);
        throw new Exception();
    }


    private static Bb.Compilers.AssemblyResult GetCsharpBuilder(string filepathCode)
    {

        var fileInfo = new FileInfo(filepathCode);

        // Build assembly

        Action<CSharpCompilationOptions> action = (r) =>
        {

        };

        BuildCSharp builder = new BuildCSharp()
        {
            ResolveAssembliesInCode = true,
            Debug = true,
            LanguageVersion = LanguageVersion.CSharp7,
        }
        .AddSource(fileInfo)
        .Suppress("CS1702", "CS1998")
        ;

        // System.Collections
        builder.References.AddRange(
            typeof(object),
            typeof(RequiredAttribute)
        );

        var assembly = builder.Build();
        return assembly;

    }        




var builder = ProjectRoslynBuilderHelper.CreateCsharpBuild("project.csproj", true);
    var result = builder.Build();

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.140 197 4/14/2025
1.0.138 188 4/14/2025
1.0.137 160 4/3/2025
1.0.136 147 4/1/2025
1.0.135 150 4/1/2025
1.0.134 150 4/1/2025
1.0.133 101 1/27/2025
1.0.132 119 12/21/2024
1.0.131 119 12/7/2024
1.0.130 104 11/27/2024
1.0.129 107 11/24/2024
1.0.128 100 11/19/2024
1.0.127 99 11/19/2024
1.0.126 103 11/18/2024
1.0.125 102 11/17/2024
1.0.124 104 11/17/2024
1.0.123 99 11/17/2024
1.0.122 103 11/17/2024
1.0.121 100 11/17/2024
1.0.120 107 10/28/2024
1.0.119 123 5/3/2024
1.0.118 116 5/2/2024
1.0.117 152 4/7/2024
1.0.116 120 4/6/2024
1.0.115 136 4/6/2024
1.0.114 148 4/3/2024
1.0.113 131 3/31/2024
1.0.112 154 3/19/2024
1.0.111 141 3/16/2024
1.0.110 146 3/16/2024
1.0.109 141 3/15/2024
1.0.108 147 3/13/2024
1.0.107 142 3/12/2024
1.0.106 124 3/9/2024
1.0.105 143 3/6/2024
1.0.104 144 3/5/2024
1.0.103 139 3/4/2024
1.0.102 136 3/4/2024
1.0.101 133 3/4/2024
1.0.100 135 3/4/2024
1.0.99 147 3/3/2024
1.0.98 135 2/29/2024
1.0.97 140 2/29/2024
1.0.96 134 2/29/2024
1.0.95 140 2/27/2024
1.0.94 132 2/26/2024
1.0.93 140 2/25/2024
1.0.92 139 2/24/2024
1.0.91 166 2/24/2024
1.0.90 136 2/24/2024
1.0.89 150 2/24/2024
1.0.88 134 2/24/2024
1.0.87 147 2/23/2024
1.0.86 141 2/23/2024
1.0.85 143 2/23/2024
1.0.84 142 2/23/2024
1.0.83 152 2/23/2024
1.0.82 144 2/23/2024
1.0.81 145 2/22/2024
1.0.80 140 2/22/2024
1.0.79 128 2/22/2024
1.0.78 128 2/22/2024
1.0.77 151 2/21/2024
1.0.76 141 2/19/2024
1.0.75 127 2/19/2024
1.0.74 133 2/18/2024
1.0.73 132 2/17/2024
1.0.72 243 12/12/2023
1.0.70 209 10/17/2023
1.0.69 150 10/17/2023
1.0.68 165 10/17/2023
1.0.67 171 10/16/2023
1.0.66 155 10/16/2023
1.0.65 166 10/13/2023
1.0.64 150 10/10/2023
1.0.63 156 9/13/2023
1.0.62 171 7/31/2023
1.0.61 169 7/28/2023
1.0.60 166 7/28/2023
1.0.59 173 7/28/2023
1.0.58 171 7/28/2023
1.0.57 190 7/28/2023
1.0.56 160 7/27/2023
1.0.55 176 7/27/2023
1.0.54 195 7/27/2023
1.0.53 177 7/27/2023
1.0.52 195 7/27/2023
1.0.51 199 7/25/2023
1.0.50 196 7/25/2023
1.0.49 206 7/4/2023
1.0.48 200 6/30/2023
1.0.47 186 6/30/2023
1.0.45 211 6/17/2023
1.0.44 199 6/17/2023
1.0.43 201 6/17/2023
1.0.42 220 6/6/2023
1.0.41 214 6/5/2023
1.0.40 202 6/5/2023
1.0.39 187 6/5/2023
1.0.38 204 5/31/2023
1.0.37 185 5/30/2023
1.0.36 194 5/30/2023
1.0.35 203 5/30/2023
1.0.33 192 5/30/2023
1.0.32 197 5/30/2023
1.0.31 215 5/30/2023
1.0.30 224 5/29/2023
1.0.29 212 5/25/2023
1.0.28 211 5/24/2023
1.0.27 213 5/18/2023
1.0.20 190 5/14/2023
1.0.18 539 5/18/2022
1.0.17 559 5/17/2022
1.0.16 535 5/17/2022
1.0.15 531 4/3/2022