From a4406c0c575d2b88183491de3db7698f1bbfeb1a Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Wed, 23 Feb 2022 14:13:19 -0300 Subject: [PATCH 1/5] Update ShowInformation --- ricaun.Nuke/Components/ICompileExample.cs | 2 +- ricaun.Nuke/Extensions/AssemblyExtension.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ricaun.Nuke/Components/ICompileExample.cs b/ricaun.Nuke/Components/ICompileExample.cs index 67c44f2..66de398 100644 --- a/ricaun.Nuke/Components/ICompileExample.cs +++ b/ricaun.Nuke/Components/ICompileExample.cs @@ -20,7 +20,7 @@ public interface ICompileExample : IHazExample, ICompile, ISign, IRelease, IHazC { Solution.BuildProject(example, (project) => { - project.ShowInfo(); + project.ShowInformation(); SignProject(project); var folder = GetExampleDirectory(project); diff --git a/ricaun.Nuke/Extensions/AssemblyExtension.cs b/ricaun.Nuke/Extensions/AssemblyExtension.cs index 9bb7930..8152954 100644 --- a/ricaun.Nuke/Extensions/AssemblyExtension.cs +++ b/ricaun.Nuke/Extensions/AssemblyExtension.cs @@ -122,15 +122,14 @@ private static FileVersionInfo GetFileVersionInfoGreater(string sourceDir, strin } /// - /// ShowInfo + /// ShowInformation /// /// - public static void ShowInfo(this Project project) + public static void ShowInformation(this Project project) { - Serilog.Log.Information($"GetAppId: {project.GetAppId()}"); - Serilog.Log.Information($"Name: {project.Name}"); Serilog.Log.Information($"-"); - + Serilog.Log.Information($"Name: {project.Name}"); + Serilog.Log.Information($"GetAppId: {project.GetAppId()}"); Serilog.Log.Information($"GetInformationalVersion: {project.GetInformationalVersion()}"); Serilog.Log.Information($"GetVersion: {project.GetVersion()}"); Serilog.Log.Information($"GetFileVersion: {project.GetFileVersion()}"); @@ -140,6 +139,7 @@ public static void ShowInfo(this Project project) Serilog.Log.Information($"GetProduct: {project.GetProduct()}"); Serilog.Log.Information($"GetCopyright: {project.GetCopyright()}"); Serilog.Log.Information($"GetDescription: {project.GetDescription()}"); + Serilog.Log.Information($"-"); //var ass = project.GetAssemblyGreaterVersion(); From 73db4c84b2078eb5e452d67931f805c065a99b7f Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Wed, 23 Feb 2022 14:29:05 -0300 Subject: [PATCH 2/5] - Add GetComments & GetFileDescription - Add ShowInformation On MainProject --- CHANGELOG.md | 5 +++++ ricaun.Nuke/Components/ICompile.cs | 6 +++++- ricaun.Nuke/Extensions/AssemblyExtension.cs | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3884251..549541b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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). +## [1.1.2] / 2022-02-23 +### Changed +- Add GetComments & GetFileDescription +- Add ShowInformation On MainProject + ## [1.1.1] / 2022-02-23 ### New Features - Compile Multiple Examples with EndWith `Name` diff --git a/ricaun.Nuke/Components/ICompile.cs b/ricaun.Nuke/Components/ICompile.cs index 456da07..2ea7a30 100644 --- a/ricaun.Nuke/Components/ICompile.cs +++ b/ricaun.Nuke/Components/ICompile.cs @@ -15,7 +15,11 @@ public interface ICompile : IClean, IHazMainProject, IHazSolution, INukeBuild .DependsOn(Clean) .Executes(() => { - Solution.BuildProject(MainProject); + Solution.BuildProject(MainProject, (project) => + { + project.ShowInformation(); + } + ); }); } } diff --git a/ricaun.Nuke/Extensions/AssemblyExtension.cs b/ricaun.Nuke/Extensions/AssemblyExtension.cs index 8152954..3dfc07f 100644 --- a/ricaun.Nuke/Extensions/AssemblyExtension.cs +++ b/ricaun.Nuke/Extensions/AssemblyExtension.cs @@ -42,6 +42,13 @@ public static class AssemblyExtension /// public static string GetFileVersion(this Project project) => project.GetFileVersionInfo().FileVersion; + /// + /// GetFileDescription => FileDescription + /// + /// + /// + public static string GetFileDescription(this Project project) => project.GetFileVersionInfo().FileDescription; + /// /// GetInformationalVersion => ProductVersion /// @@ -63,6 +70,13 @@ public static class AssemblyExtension /// public static string GetDescription(this Project project) => project.GetFileVersionInfo().Comments; + /// + /// GetComments => Comments + /// + /// + /// + public static string GetComments(this Project project) => project.GetFileVersionInfo().Comments; + /// /// GetCopyright => LegalCopyright /// @@ -139,6 +153,8 @@ public static void ShowInformation(this Project project) Serilog.Log.Information($"GetProduct: {project.GetProduct()}"); Serilog.Log.Information($"GetCopyright: {project.GetCopyright()}"); Serilog.Log.Information($"GetDescription: {project.GetDescription()}"); + Serilog.Log.Information($"GetComments: {project.GetComments()}"); + Serilog.Log.Information($"GetFileDescription: {project.GetFileDescription()}"); Serilog.Log.Information($"-"); //var ass = project.GetAssemblyGreaterVersion(); From 262124c0415f82df6d9b81d33c0e47accbea1991 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Wed, 23 Feb 2022 14:30:39 -0300 Subject: [PATCH 3/5] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 549541b..9d36846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,6 +145,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - First Release [vNext]: ../../compare/1.0.0...HEAD +[1.1.2]: ../../compare/1.1.1...1.1.2 [1.1.1]: ../../compare/1.1.0...1.1.1 [1.1.0]: ../../compare/1.0.2...1.1.0 [1.0.2]: ../../compare/1.0.1...1.0.2 From 3221674d7dd036a26fbfc831b2b4d10bd334b145 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Wed, 23 Feb 2022 15:06:37 -0300 Subject: [PATCH 4/5] ### Bug Fixes - Null GetFileVersionInfo set Warning --- CHANGELOG.md | 3 ++ .../ricaun.Nuke.RevitAddin.Example.csproj | 2 +- ricaun.Nuke/Extensions/AssemblyExtension.cs | 41 +++++++++++++------ 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d36846..97ff6fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ 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). ## [1.1.2] / 2022-02-23 +### Bug Fixes +- Null GetFileVersionInfo set Warning ### Changed +- Add GetAssemblyName - Add GetComments & GetFileDescription - Add ShowInformation On MainProject diff --git a/ricaun.Nuke.RevitAddin.Example/ricaun.Nuke.RevitAddin.Example.csproj b/ricaun.Nuke.RevitAddin.Example/ricaun.Nuke.RevitAddin.Example.csproj index 8a3b27a..e1cda98 100644 --- a/ricaun.Nuke.RevitAddin.Example/ricaun.Nuke.RevitAddin.Example.csproj +++ b/ricaun.Nuke.RevitAddin.Example/ricaun.Nuke.RevitAddin.Example.csproj @@ -82,7 +82,7 @@ - + .$(Version) $([System.DateTime]::Now.ToString('ffff')) diff --git a/ricaun.Nuke/Extensions/AssemblyExtension.cs b/ricaun.Nuke/Extensions/AssemblyExtension.cs index 3dfc07f..8639981 100644 --- a/ricaun.Nuke/Extensions/AssemblyExtension.cs +++ b/ricaun.Nuke/Extensions/AssemblyExtension.cs @@ -20,75 +20,87 @@ public static class AssemblyExtension /// /// /// - public static Version GetVersion(this Project project) => new Version(project.GetFileVersionInfo().ProductVersion); + public static Version GetVersion(this Project project) + { + var version = project.GetFileVersionInfo()?.ProductVersion; + if (version == null) version = "0.0.0.0"; + return new Version(version); + } /// /// GetProduct => ProductName /// /// /// - public static string GetProduct(this Project project) => project.GetFileVersionInfo().ProductName; + public static string GetProduct(this Project project) => project.GetFileVersionInfo()?.ProductName; /// - /// + /// GetTitle => ProductName /// /// /// - public static string GetTitle(this Project project) => project.GetFileVersionInfo().ProductName; + public static string GetTitle(this Project project) => project.GetFileVersionInfo()?.ProductName; /// /// GetFileVersion => FileVersion /// /// /// - public static string GetFileVersion(this Project project) => project.GetFileVersionInfo().FileVersion; + public static string GetFileVersion(this Project project) => project.GetFileVersionInfo()?.FileVersion; /// /// GetFileDescription => FileDescription /// /// /// - public static string GetFileDescription(this Project project) => project.GetFileVersionInfo().FileDescription; + public static string GetFileDescription(this Project project) => project.GetFileVersionInfo()?.FileDescription; + + /// + /// GetAssemblyName => FileDescription + /// + /// + /// + public static string GetAssemblyName(this Project project) => project.GetFileVersionInfo()?.FileDescription; /// /// GetInformationalVersion => ProductVersion /// /// /// - public static string GetInformationalVersion(this Project project) => project.GetFileVersionInfo().ProductVersion; + public static string GetInformationalVersion(this Project project) => project.GetFileVersionInfo()?.ProductVersion; /// /// GetCompany => CompanyName /// /// /// - public static string GetCompany(this Project project) => project.GetFileVersionInfo().CompanyName; + public static string GetCompany(this Project project) => project.GetFileVersionInfo()?.CompanyName; /// /// GetDescription => Comments /// /// /// - public static string GetDescription(this Project project) => project.GetFileVersionInfo().Comments; + public static string GetDescription(this Project project) => project.GetFileVersionInfo()?.Comments; /// /// GetComments => Comments /// /// /// - public static string GetComments(this Project project) => project.GetFileVersionInfo().Comments; + public static string GetComments(this Project project) => project.GetFileVersionInfo()?.Comments; /// /// GetCopyright => LegalCopyright /// /// /// - public static string GetCopyright(this Project project) => project.GetFileVersionInfo().LegalCopyright; + public static string GetCopyright(this Project project) => project.GetFileVersionInfo()?.LegalCopyright; /// /// GetTrademark => LegalTrademarks /// /// /// - public static string GetTrademark(this Project project) => project.GetFileVersionInfo().LegalTrademarks; + public static string GetTrademark(this Project project) => project.GetFileVersionInfo()?.LegalTrademarks; /// /// Get ProjectId @@ -144,7 +156,12 @@ public static void ShowInformation(this Project project) Serilog.Log.Information($"-"); Serilog.Log.Information($"Name: {project.Name}"); Serilog.Log.Information($"GetAppId: {project.GetAppId()}"); + + if (project.GetFileVersionInfo() == null) + Serilog.Log.Warning($"GetFileVersionInfo: {project.Name} not found!"); + Serilog.Log.Information($"GetInformationalVersion: {project.GetInformationalVersion()}"); + Serilog.Log.Information($"GetAssemblyName: {project.GetAssemblyName()}"); Serilog.Log.Information($"GetVersion: {project.GetVersion()}"); Serilog.Log.Information($"GetFileVersion: {project.GetFileVersion()}"); Serilog.Log.Information($"GetTitle: {project.GetTitle()}"); From 76493b91709d3eabd01214ab59e739abc016fef6 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Wed, 23 Feb 2022 15:07:07 -0300 Subject: [PATCH 5/5] 1.1.2 --- ricaun.Nuke/ricaun.Nuke.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ricaun.Nuke/ricaun.Nuke.csproj b/ricaun.Nuke/ricaun.Nuke.csproj index dcbff72..a38a09d 100644 --- a/ricaun.Nuke/ricaun.Nuke.csproj +++ b/ricaun.Nuke/ricaun.Nuke.csproj @@ -7,7 +7,7 @@ ricaun.Nuke - 1.1.1 + 1.1.2