Moved pre-build auto gen file to Resources folder.
Improved builddate generation
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@@ -6,9 +6,9 @@ Arrestanten_planbord/DataStore
|
||||
/Arrestanten_planbord/logs
|
||||
/Arrestanten_planbord.UnitTest/obj
|
||||
/Arrestanten_planbord.UnitTest/bin
|
||||
/Arrestanten_planbord/changelog.txt
|
||||
/Arrestanten_planbord/Commit.txt
|
||||
/Arrestanten_planbord/CommitDate.txt
|
||||
/Arrestanten_planbord/Tag.txt
|
||||
DataStoreTest
|
||||
/Arrestanten_planbord/Buildtime.txt
|
||||
/Arrestanten_planbord/Resources/BuildDate.txt
|
||||
/Arrestanten_planbord/Resources/ChangeLog.txt
|
||||
/Arrestanten_planbord/Resources/Commit.txt
|
||||
/Arrestanten_planbord/Resources/CommitDate.txt
|
||||
/Arrestanten_planbord/Resources/Tag.txt
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="echo PREBUILDSTEP for $(ProjectName)
git rev-parse --short HEAD > "$(ProjectDir)\Commit.txt"
git log -1 --pretty=format:"%25%25cd" --date=format:"%25%25d-%25%25m-%25%25Y %25%25H:%25%25M:%25%25S" > "$(ProjectDir)\CommitDate.txt"
git describe --tags --dirty > "$(ProjectDir)\Tag.txt"
git log --pretty=format:"%25%25ad - %25%25d %25%25s" --date=format:"%25%25d-%25%25m-%25%25Y %25%25H:%25%25M:%25%25S" > "$(ProjectDir)\changelog.txt"
date /t > "$(ProjectDir)\Buildtime.txt"
time /t >> "$(ProjectDir)\Buildtime.txt"
" />
|
||||
<Exec Command="echo PREBUILDSTEP for $(ProjectName)
git rev-parse --short HEAD > "$(ProjectDir)\Resources\Commit.txt"
git log -1 --pretty=format:"%25%25cd" --date=format:"%25%25d-%25%25m-%25%25Y %25%25H:%25%25M:%25%25S" > "$(ProjectDir)\Resources\CommitDate.txt"
git describe --tags --dirty > "$(ProjectDir)\Resources\Tag.txt"
git log --pretty=format:"%25%25ad - %25%25d %25%25s" --date=format:"%25%25d-%25%25m-%25%25Y %25%25H:%25%25M:%25%25S" > "$(ProjectDir)\Resources\ChangeLog.txt"
echo %25date%25 %25time%25 > "$(ProjectDir)\Resources\BuildDate.txt"
" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" BeforeTargets="PostBuildEvent">
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Arrestanten_planbord.Helpers
|
||||
{
|
||||
@@ -12,14 +10,8 @@ namespace Arrestanten_planbord.Helpers
|
||||
|
||||
public static string GetCommitDate() => Properties.Resources.CommitDate;
|
||||
|
||||
public static string GetChangelog() => Properties.Resources.changelog;
|
||||
public static string GetChangelog() => Properties.Resources.ChangeLog;
|
||||
|
||||
public static string GetBuildTime()
|
||||
{
|
||||
string str = Properties.Resources.Buildtime;
|
||||
Regex newline = new Regex("\r\n");
|
||||
str = newline.Replace(str, "- ", 1);
|
||||
return newline.Replace(str, string.Empty, 1);
|
||||
}
|
||||
public static string GetBuildDate() => Properties.Resources.BuildDate.Replace("\r\n", string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<MatDivider></MatDivider>
|
||||
<p>Arrestanten bord version = <a href="@Arrestanten_planbord.Helpers.GitHelper.GetGitVersionLink()">@Arrestanten_planbord.Helpers.GitHelper.GetGitVersion()</a></p>
|
||||
<p>Arrestanten bord Commit date = @Arrestanten_planbord.Helpers.GitHelper.GetCommitDate()</p>
|
||||
<p>Arrestanten bord Build date = @Arrestanten_planbord.Helpers.GitHelper.GetBuildTime()</p>
|
||||
<p>Arrestanten bord Build date = @Arrestanten_planbord.Helpers.GitHelper.GetBuildDate()</p>
|
||||
</MatBody1>
|
||||
</MatCardContent>
|
||||
</MatCard>
|
||||
|
||||
@@ -20,14 +20,8 @@ namespace Arrestanten_planbord
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
//var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
||||
//Console.WriteLine("configpath = " + configPath);
|
||||
//IConfiguration configuration = new ConfigurationBuilder().AddJsonFile(configPath).Build();
|
||||
|
||||
//Console.WriteLine("Config File Path = " + Configuration.);
|
||||
|
||||
Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(Configuration).Enrich.FromLogContext().CreateLogger();
|
||||
Log.Information($"Starting {Assembly.GetEntryAssembly().GetName().Name} {Helpers.GitHelper.GetGitVersion()} build {Helpers.GitHelper.GetBuildTime()}");
|
||||
Log.Information($"Starting {Assembly.GetEntryAssembly().GetName().Name} {Helpers.GitHelper.GetGitVersion()} build {Helpers.GitHelper.GetBuildDate()}");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -61,36 +61,34 @@ namespace Arrestanten_planbord.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ma 21-09-2020
|
||||
///14:13
|
||||
/// Looks up a localized string similar to ma 21-09-2020 14:59:18,87
|
||||
///.
|
||||
/// </summary>
|
||||
internal static string Buildtime {
|
||||
internal static string BuildDate {
|
||||
get {
|
||||
return ResourceManager.GetString("Buildtime", resourceCulture);
|
||||
return ResourceManager.GetString("BuildDate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 21-09-2020 08:40:09 - (HEAD -> master) Show culture in system information
|
||||
/// Looks up a localized string similar to 21-09-2020 14:38:04 - (HEAD -> master, origin/master) Added install/remove service scripts. Project uses service. Buildtime added
|
||||
///21-09-2020 08:40:09 - Show culture in system information
|
||||
///21-09-2020 08:39:40 - Add useWindowsService
|
||||
///21-09-2020 08:09:26 - (origin/master) Keep file in publish folder
|
||||
///21-09-2020 08:09:26 - Keep file in publish folder
|
||||
///18-09-2020 08:06:41 - Removed unused mDNS files
|
||||
///16-09-2020 15:08:13 - HealthStatusIcon.razor code
|
||||
///16-09-2020 09:23:33 - Removed folders from project
|
||||
///16-09-2020 09:23:09 - Publish profiles to .net 5
|
||||
///16-09-2020 09:22:41 - reworked health checks
|
||||
///15-09-2020 10:29:26 - Remove TimerService.cs
|
||||
///15-09-2020 10 [rest of string was truncated]";.
|
||||
///16-09-202 [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string changelog {
|
||||
internal static string ChangeLog {
|
||||
get {
|
||||
return ResourceManager.GetString("changelog", resourceCulture);
|
||||
return ResourceManager.GetString("ChangeLog", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 80a08de
|
||||
/// Looks up a localized string similar to 2426d49
|
||||
///.
|
||||
/// </summary>
|
||||
internal static string Commit {
|
||||
@@ -100,7 +98,7 @@ namespace Arrestanten_planbord.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 21-09-2020 08:40:09.
|
||||
/// Looks up a localized string similar to 21-09-2020 14:38:04.
|
||||
/// </summary>
|
||||
internal static string CommitDate {
|
||||
get {
|
||||
@@ -109,7 +107,7 @@ namespace Arrestanten_planbord.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 0.1-88-g80a08de-dirty
|
||||
/// Looks up a localized string similar to 0.1-89-g2426d49-dirty
|
||||
///.
|
||||
/// </summary>
|
||||
internal static string Tag {
|
||||
|
||||
@@ -118,19 +118,19 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Buildtime" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Buildtime.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<data name="BuildDate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\BuildDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="changelog" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\changelog.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<data name="ChangeLog" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ChangeLog.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="Commit" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Commit.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<value>..\Resources\Commit.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="CommitDate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\CommitDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<value>..\Resources\CommitDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="Tag" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Tag.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<value>..\Resources\Tag.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user