forked from criticalmanufacturing/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(new): application version #3
Open
jgabrielmaia
wants to merge
1
commit into
development-app-deployment-manifest
Choose a base branch
from
development-spike-application-version
base: development-app-deployment-manifest
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project name instead of Tenant