Skip to content

Commit

Permalink
Merge pull request #27 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Develop 1.1.2
  • Loading branch information
ricaun authored Feb 23, 2022
2 parents c8a1c93 + 76493b9 commit 28c13d0
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 18 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

## [1.1.2] / 2022-02-23
### Bug Fixes
- Null GetFileVersionInfo set Warning
### Changed
- Add GetAssemblyName
- Add GetComments & GetFileDescription
- Add ShowInformation On MainProject

## [1.1.1] / 2022-02-23
### New Features
- Compile Multiple Examples with EndWith `Name`
Expand Down Expand Up @@ -140,6 +148,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageAssemblyVersion></PackageAssemblyVersion>
<PackageAssemblyVersion>.$(Version)</PackageAssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<Revision>$([System.DateTime]::Now.ToString('ffff'))</Revision>
Expand Down
6 changes: 5 additions & 1 deletion ricaun.Nuke/Components/ICompile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ public interface ICompile : IClean, IHazMainProject, IHazSolution, INukeBuild
.DependsOn(Clean)
.Executes(() =>
{
Solution.BuildProject(MainProject);
Solution.BuildProject(MainProject, (project) =>
{
project.ShowInformation();
}
);
});
}
}
2 changes: 1 addition & 1 deletion ricaun.Nuke/Components/ICompileExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
61 changes: 47 additions & 14 deletions ricaun.Nuke/Extensions/AssemblyExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,87 @@ public static class AssemblyExtension
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
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);
}

/// <summary>
/// GetProduct => ProductName
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetProduct(this Project project) => project.GetFileVersionInfo().ProductName;
public static string GetProduct(this Project project) => project.GetFileVersionInfo()?.ProductName;
/// <summary>
///
/// GetTitle => ProductName
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetTitle(this Project project) => project.GetFileVersionInfo().ProductName;
public static string GetTitle(this Project project) => project.GetFileVersionInfo()?.ProductName;

/// <summary>
/// GetFileVersion => FileVersion
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetFileVersion(this Project project) => project.GetFileVersionInfo().FileVersion;
public static string GetFileVersion(this Project project) => project.GetFileVersionInfo()?.FileVersion;

/// <summary>
/// GetFileDescription => FileDescription
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetFileDescription(this Project project) => project.GetFileVersionInfo()?.FileDescription;

/// <summary>
/// GetAssemblyName => FileDescription
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetAssemblyName(this Project project) => project.GetFileVersionInfo()?.FileDescription;

/// <summary>
/// GetInformationalVersion => ProductVersion
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetInformationalVersion(this Project project) => project.GetFileVersionInfo().ProductVersion;
public static string GetInformationalVersion(this Project project) => project.GetFileVersionInfo()?.ProductVersion;

/// <summary>
/// GetCompany => CompanyName
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetCompany(this Project project) => project.GetFileVersionInfo().CompanyName;
public static string GetCompany(this Project project) => project.GetFileVersionInfo()?.CompanyName;

/// <summary>
/// GetDescription => Comments
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetDescription(this Project project) => project.GetFileVersionInfo().Comments;
public static string GetDescription(this Project project) => project.GetFileVersionInfo()?.Comments;

/// <summary>
/// GetComments => Comments
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetComments(this Project project) => project.GetFileVersionInfo()?.Comments;

/// <summary>
/// GetCopyright => LegalCopyright
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetCopyright(this Project project) => project.GetFileVersionInfo().LegalCopyright;
public static string GetCopyright(this Project project) => project.GetFileVersionInfo()?.LegalCopyright;
/// <summary>
/// GetTrademark => LegalTrademarks
/// </summary>
/// <param name="project"></param>
/// <returns></returns>
public static string GetTrademark(this Project project) => project.GetFileVersionInfo().LegalTrademarks;
public static string GetTrademark(this Project project) => project.GetFileVersionInfo()?.LegalTrademarks;

/// <summary>
/// Get ProjectId
Expand Down Expand Up @@ -122,16 +148,20 @@ private static FileVersionInfo GetFileVersionInfoGreater(string sourceDir, strin
}

/// <summary>
/// ShowInfo
/// ShowInformation
/// </summary>
/// <param name="project"></param>
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()}");

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()}");
Expand All @@ -140,6 +170,9 @@ 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($"GetComments: {project.GetComments()}");
Serilog.Log.Information($"GetFileDescription: {project.GetFileDescription()}");
Serilog.Log.Information($"-");

//var ass = project.GetAssemblyGreaterVersion();

Expand Down
2 changes: 1 addition & 1 deletion ricaun.Nuke/ricaun.Nuke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>ricaun.Nuke</PackageId>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 28c13d0

Please sign in to comment.