forked from criticalmanufacturing/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonas Maia
authored and
Jonas Maia
committed
Apr 4, 2024
1 parent
cba0b4d
commit 854c73b
Showing
6 changed files
with
227 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
...template_feed/business/from900/Business.Package/ApplicationVersion/%Tenant%VersionInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
| ||
#region Using Directives | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Reflection; | ||
|
||
using Cmf.Foundation.ApplicationVersion; | ||
|
||
|
||
#endregion Using Directives | ||
|
||
namespace Cmf.<%= $CLI_PARAM_Tenant %>.ApplicationVersion | ||
{ | ||
/// <summary> | ||
/// NRepresents the application version information gathering. | ||
/// </summary> | ||
[Export(typeof(IApplicationVersionInfo))] | ||
public sealed class <%= $CLI_PARAM_Tenant %>VersionInfo : IApplicationVersionInfo | ||
{ | ||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets or sets the application build date. | ||
/// </summary> | ||
public DateTime BuildDate | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the build number of the file. | ||
/// </summary> | ||
public int FileBuildPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the major part of the file version number. | ||
/// </summary> | ||
public int FileMajorPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the minor part of the file version number. | ||
/// </summary> | ||
public int FileMinorPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the file private part. | ||
/// </summary> | ||
/// <value> | ||
/// The file private part. | ||
/// </value> | ||
public int FilePrivatePart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the build of the product this file is associated with. | ||
/// </summary> | ||
public int ProductBuildPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the major part of the file version number. | ||
/// </summary> | ||
public int ProductMajorPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the minor part of the product this file is associated with. | ||
/// </summary> | ||
public int ProductMinorPart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the product name. | ||
/// </summary> | ||
public string ProductName | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the product private part. | ||
/// </summary> | ||
/// <value> | ||
/// The product private part. | ||
/// </value> | ||
public int ProductPrivatePart | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
#endregion | ||
|
||
#region Constructors | ||
#endregion | ||
|
||
#region Private & Internal Methods | ||
#endregion | ||
|
||
#region Public Methods | ||
|
||
/// <summary> | ||
/// Gets the version information. | ||
/// </summary> | ||
public void GetVersionInfo() | ||
{ | ||
Assembly asm = Assembly.GetExecutingAssembly(); | ||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location); | ||
FileInfo fi = new FileInfo(asm.Location); | ||
|
||
Version version = asm.GetName().Version; | ||
|
||
this.FileMajorPart = fvi.FileMajorPart; | ||
this.FileMinorPart = fvi.FileMinorPart; | ||
this.FileBuildPart = fvi.FileBuildPart; | ||
this.FilePrivatePart = fvi.FilePrivatePart; | ||
this.BuildDate = fi.LastWriteTimeUtc.ToLocalTime(); | ||
|
||
this.ProductMajorPart = version.Major; | ||
this.ProductMinorPart = version.Minor; | ||
this.ProductBuildPart = version.Build; | ||
this.ProductPrivatePart = version.Revision; | ||
|
||
this.ProductName = fvi.ProductName; | ||
} | ||
|
||
#endregion | ||
|
||
#region Event handling Methods | ||
#endregion | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...sources/template_feed/business/from900/Business.Package/ApplicationVersion/Version.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AssemblyTitle>ApplicationVersion</AssemblyTitle> | ||
<RootNamespace>Cmf.Custom.<%= $CLI_PARAM_idSegment %>.ApplicationVersion</RootNamespace> | ||
<AssemblyName>Cmf.<%= $CLI_PARAM_Tenant %>.ApplicationVersion</AssemblyName> | ||
<Product><%= $CLI_PARAM_Tenant %></Product> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<AssemblyVersion><%= $CLI_PARAM_assemblyVersion %></AssemblyVersion> | ||
<FileVersion><%= $CLI_PARAM_fileVersion %></FileVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\..\LocalEnvironment\BusinessTier</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath>..\Release</OutputPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Cmf.Foundation.ApplicationVersion" Version="10.2.1" /> | ||
<PackageReference Include="System.ComponentModel.Composition" Version="6.0.0" /> | ||
<PackageReference Include="System.Composition.AttributedModel" Version="7.0.0" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,4 @@ public enum PackageType | |
/// </summary> | ||
ProductDatabase = 15, | ||
} | ||
} | ||
} |