Black.Beard.Schemas 1.0.18

There is a newer version of this package available.
See the version list below for details.
dotnet add package Black.Beard.Schemas --version 1.0.18
NuGet\Install-Package Black.Beard.Schemas -Version 1.0.18
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.Schemas" Version="1.0.18" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Black.Beard.Schemas --version 1.0.18
#r "nuget: Black.Beard.Schemas, 1.0.18"
#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.
// Install Black.Beard.Schemas as a Cake Addin
#addin nuget:?package=Black.Beard.Schemas&version=1.0.18

// Install Black.Beard.Schemas as a Cake Tool
#tool nuget:?package=Black.Beard.Schemas&version=1.0.18

Black.Beard.Roslyn

Build status

Helpers for compile Csharp with Roslyn. The way use the tool installed on your machine. It does'nt work in 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 = new MsProject(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;

    }        

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. 
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.119 52 5/3/2024
1.0.118 56 5/2/2024
1.0.117 89 4/7/2024
1.0.116 74 4/6/2024
1.0.115 71 4/6/2024
1.0.114 78 4/3/2024
1.0.113 83 3/31/2024
1.0.112 98 3/19/2024
1.0.111 95 3/16/2024
1.0.110 83 3/16/2024
1.0.109 82 3/15/2024
1.0.108 85 3/13/2024
1.0.107 83 3/12/2024
1.0.106 86 3/9/2024
1.0.105 95 3/6/2024
1.0.104 92 3/5/2024
1.0.103 82 3/4/2024
1.0.102 83 3/4/2024
1.0.101 81 3/4/2024
1.0.100 86 3/4/2024
1.0.99 84 3/3/2024
1.0.98 90 2/29/2024
1.0.97 88 2/29/2024
1.0.96 81 2/29/2024
1.0.95 97 2/27/2024
1.0.94 80 2/26/2024
1.0.93 83 2/25/2024
1.0.92 80 2/24/2024
1.0.91 84 2/24/2024
1.0.90 77 2/24/2024
1.0.89 84 2/24/2024
1.0.88 77 2/24/2024
1.0.87 81 2/23/2024
1.0.86 90 2/23/2024
1.0.85 90 2/23/2024
1.0.84 87 2/23/2024
1.0.83 85 2/23/2024
1.0.82 72 2/23/2024
1.0.81 89 2/22/2024
1.0.80 83 2/22/2024
1.0.79 73 2/22/2024
1.0.78 70 2/22/2024
1.0.77 92 2/21/2024
1.0.76 90 2/19/2024
1.0.75 65 2/19/2024
1.0.74 80 2/18/2024
1.0.73 78 2/17/2024
1.0.72 167 12/12/2023
1.0.70 163 10/17/2023
1.0.69 97 10/17/2023
1.0.68 86 10/17/2023
1.0.67 119 10/16/2023
1.0.66 117 10/16/2023
1.0.65 124 10/13/2023
1.0.64 117 10/10/2023
1.0.63 124 9/13/2023
1.0.62 142 7/31/2023
1.0.61 130 7/28/2023
1.0.60 140 7/28/2023
1.0.59 135 7/28/2023
1.0.58 139 7/28/2023
1.0.57 135 7/28/2023
1.0.56 129 7/27/2023
1.0.55 109 7/27/2023
1.0.54 149 7/27/2023
1.0.53 119 7/27/2023
1.0.52 134 7/27/2023
1.0.51 165 7/25/2023
1.0.50 157 7/25/2023
1.0.49 144 7/4/2023
1.0.48 172 6/30/2023
1.0.47 165 6/30/2023
1.0.46 159 6/30/2023
1.0.45 166 6/17/2023
1.0.44 140 6/17/2023
1.0.43 139 6/17/2023
1.0.42 149 6/6/2023
1.0.41 137 6/5/2023
1.0.40 142 6/5/2023
1.0.39 138 6/5/2023
1.0.38 141 5/31/2023
1.0.37 145 5/30/2023
1.0.36 137 5/30/2023
1.0.35 120 5/30/2023
1.0.33 124 5/30/2023
1.0.32 140 5/30/2023
1.0.31 158 5/30/2023
1.0.30 126 5/29/2023
1.0.29 146 5/25/2023
1.0.28 158 5/24/2023
1.0.27 149 5/18/2023
1.0.26 152 5/18/2023
1.0.25 133 5/18/2023
1.0.24 153 5/16/2023
1.0.23 133 5/15/2023
1.0.22 132 5/15/2023
1.0.21 131 5/14/2023
1.0.20 142 5/14/2023
1.0.18 382 5/18/2022
1.0.17 416 5/17/2022
1.0.16 395 5/17/2022
1.0.15 409 4/3/2022