From 45bb42b421424d425903e53c4d38610988e4756e Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Fri, 17 Dec 2021 13:42:32 -0300 Subject: [PATCH] ## [0.0.9] / 2021-12-17 - Clear Build - Test Native Example Compile - Rename Example Project - Add ICompileExample - Add IHazExample - Add Native Example Compile --- Build/.nuke/build.schema.json | 10 +++++-- Build/Build.cs | 2 +- CHANGELOG.md | 8 ++++++ ...ples.csproj => ricaun.Nuke.Example.csproj} | 0 ricaun.Nuke.sln | 2 +- .../Components/ICompileExample.cs | 12 +++++---- ricaun.Nuke/Components/IHazExample.cs | 27 +++++++++++++++++++ ricaun.Nuke/ricaun.Nuke.csproj | 2 +- 8 files changed, 53 insertions(+), 10 deletions(-) rename Examples/{Examples.csproj => ricaun.Nuke.Example.csproj} (100%) rename Build/IExampleCompile.cs => ricaun.Nuke/Components/ICompileExample.cs (58%) create mode 100644 ricaun.Nuke/Components/IHazExample.cs diff --git a/Build/.nuke/build.schema.json b/Build/.nuke/build.schema.json index 4f6dea6..175d8ed 100644 --- a/Build/.nuke/build.schema.json +++ b/Build/.nuke/build.schema.json @@ -10,6 +10,9 @@ "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, + "Folder": { + "type": "string" + }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" @@ -34,6 +37,9 @@ "VSCode" ] }, + "Name": { + "type": "string" + }, "NoLogo": { "type": "boolean", "description": "Disables displaying the NUKE logo" @@ -66,7 +72,7 @@ "Build", "Clean", "Compile", - "ExampleCompile", + "CompileExample", "GitRelease", "Pack", "Release", @@ -87,7 +93,7 @@ "Build", "Clean", "Compile", - "ExampleCompile", + "CompileExample", "GitRelease", "Pack", "Release", diff --git a/Build/Build.cs b/Build/Build.cs index 8086cc5..113c62f 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -4,7 +4,7 @@ using ricaun.Nuke.Components; [CheckBuildProjectConfigurations] -class Build : NukeBuild, IPublishPack, IExampleCompile +class Build : NukeBuild, IPublishPack, ICompileExample { string IHazContent.Folder => "Release"; string IHazRelease.Folder => "ReleasePack"; diff --git a/CHANGELOG.md b/CHANGELOG.md index c5d75cb..5ea29a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.0.9] / 2021-12-17 +- Clear Build +- Test Native Example Compile +- Rename Example Project +- Add ICompileExample +- Add IHazExample +- Add Native Example Compile + ## [0.0.8] / 2021-12-17 - Release Example Project - Add Example Project diff --git a/Examples/Examples.csproj b/Examples/ricaun.Nuke.Example.csproj similarity index 100% rename from Examples/Examples.csproj rename to Examples/ricaun.Nuke.Example.csproj diff --git a/ricaun.Nuke.sln b/ricaun.Nuke.sln index b62ed0e..8bf7379 100644 --- a/ricaun.Nuke.sln +++ b/ricaun.Nuke.sln @@ -13,7 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{4EED README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples", "Examples\Examples.csproj", "{027171E5-2FB6-4A4C-A8DE-F3E148B47FFB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ricaun.Nuke.Example", "Examples\ricaun.Nuke.Example.csproj", "{027171E5-2FB6-4A4C-A8DE-F3E148B47FFB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Build/IExampleCompile.cs b/ricaun.Nuke/Components/ICompileExample.cs similarity index 58% rename from Build/IExampleCompile.cs rename to ricaun.Nuke/Components/ICompileExample.cs index d8d528b..31fe10b 100644 --- a/Build/IExampleCompile.cs +++ b/ricaun.Nuke/Components/ICompileExample.cs @@ -1,21 +1,23 @@ using Nuke.Common; -using ricaun.Nuke.Components; using ricaun.Nuke.Extensions; -public interface IExampleCompile : ICompile, ISign, IRelease, IHazContent +namespace ricaun.Nuke.Components { - Target ExampleCompile => _ => _ + public interface ICompileExample : IHazExample, ICompile, ISign, IRelease, IHazContent, INukeBuild + { + Target CompileExample => _ => _ .TriggeredBy(Compile) .Before(Sign) .Executes(() => { - Solution.BuildOtherProject("Examples", (project) => + Solution.BuildOtherProject(GetExampleProject(), (project) => { SignProject(project); - var folder = GetContentDirectory(project); + var folder = ExampleDirectory; var fileName = project.Name; var zipFile = ReleaseDirectory / $"{fileName}.zip"; ZipExtension.CreateFromDirectory(folder, zipFile); }); }); + } } diff --git a/ricaun.Nuke/Components/IHazExample.cs b/ricaun.Nuke/Components/IHazExample.cs new file mode 100644 index 0000000..b47230b --- /dev/null +++ b/ricaun.Nuke/Components/IHazExample.cs @@ -0,0 +1,27 @@ +using System; +using Nuke.Common; +using Nuke.Common.IO; +using Nuke.Common.ProjectModel; +using Nuke.Common.ValueInjection; +using ricaun.Nuke.Extensions; +namespace ricaun.Nuke.Components +{ + public interface IHazExample : IHazSolution, INukeBuild + { + /// + /// Folder Example + /// + [Parameter] + string Folder => ValueInjectionUtility.TryGetValue(() => Folder) ?? "Release"; + + /// + /// Example Project Name + /// + [Parameter] + string Name => ValueInjectionUtility.TryGetValue(() => Name) ?? $"{Solution.Name}.Example"; + + AbsolutePath ExampleDirectory => GetExampleDirectory(GetExampleProject()); + public Project GetExampleProject() => Solution.GetOtherProject(Name); + public AbsolutePath GetExampleDirectory(Project project) => project.Directory / "bin" / Folder; + } +} diff --git a/ricaun.Nuke/ricaun.Nuke.csproj b/ricaun.Nuke/ricaun.Nuke.csproj index e3f4c8a..80b4bdb 100644 --- a/ricaun.Nuke/ricaun.Nuke.csproj +++ b/ricaun.Nuke/ricaun.Nuke.csproj @@ -7,7 +7,7 @@ ricaun.Nuke - 0.0.8 + 0.0.9