Skip to content

Commit

Permalink
Disable Git commit ID in Product Version
Browse files Browse the repository at this point in the history
Reference: dotnet/sdk#34568
  • Loading branch information
DavidCarbon committed Dec 14, 2023
1 parent 04b8f82 commit 42cd32f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 169 deletions.
31 changes: 0 additions & 31 deletions AutoUpdateBuildDate.ps1

This file was deleted.

119 changes: 0 additions & 119 deletions AutoUpdateVersion.ps1

This file was deleted.

24 changes: 12 additions & 12 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ try

# Update the constant variable BUILD_DATE with the current date
$currentDate = Get-Date -Format "MM-dd-yyyy"
$newBuildInfoContent = $buildInformationClassFileContent -replace 'const\s+string\s+DATE\s*=\s*".*"', "const string DATE = `"$currentDate`";"
$newBuildInfoContent = $buildInformationClassFileContent -replace 'const\s+string\s+DATE\s*=\s*".*";', "const string DATE = `"$currentDate`";"

# Update the constant variable BUILD_TIME with the current UTC time
$currentTime = Get-Date -Format "HHmmss"
$newBuildInfoContent = $newBuildInfoContent -replace 'const\s+string\s+TIME\s*=\s*".*"', "const string TIME = `"$currentTime`";"
$newBuildInfoContent = $newBuildInfoContent -replace 'const\s+string\s+TIME\s*=\s*".*";', "const string TIME = `"$currentTime`";"

$currentTimeZone = Get-Date -Format "zzz"
$newBuildInfoContent = $newBuildInfoContent -replace 'const\s+string\s+TIME_ZONE\s*=\s*".*"', "const string TIME_ZONE = `"$currentTimeZone`";"
$newBuildInfoContent = $newBuildInfoContent -replace 'const\s+string\s+TIME_ZONE\s*=\s*".*";', "const string TIME_ZONE = `"$currentTimeZone`";"

# Save the updated content back to the C# class file
$newBuildInfoContent | Set-Content $buildInformationClassFilePath -Force
$newBuildInfoContent | Set-Content $buildInformationClassFilePath -NoNewline

echo ([string]::Format("========== DATE updated to: {0} ==========", $currentDate))
echo ([string]::Format("========== TIME updated to: {0} ==========", $currentTime))
Expand All @@ -77,7 +77,7 @@ try
catch
{
throw $_
return
exit 1
}

try
Expand Down Expand Up @@ -110,16 +110,16 @@ try
$newBuildBetaContent = $buildBetaFileContent -replace 'private static bool Enabled = .*;', ([string]::Format('private static bool Enabled = {0};', $BuildBetaBoolean))

# Save the updated content back to the C# class file
$newBuildDevContent | Set-Content $buildDevelopmentClassFilePath -Force
$newBuildBetaContent | Set-Content $buildBetaClassFilePath -Force
$newBuildDevContent | Set-Content $buildDevelopmentClassFilePath -NoNewline
$newBuildBetaContent | Set-Content $buildBetaClassFilePath -NoNewline

echo ([string]::Format("========== Development Enabled: {0} ==========", $BuildDevBoolean))
echo ([string]::Format("========== Beta Enabled: {0} ==========", $BuildBetaBoolean))
}
catch
{
throw $_
return
exit 1
}

try
Expand Down Expand Up @@ -229,14 +229,14 @@ try
$xmlWriter.Close()

#Save csproj (Formatted XML)
$stringWriter.ToString() | Out-File $path -Force
$stringWriter.ToString() | Out-File $path -NoNewline

echo ([string]::Format("========== New Version Number: {0}.{1}.{2} ==========",$xml.Project.PropertyGroup.VersionMajor,$xml.Project.PropertyGroup.VersionMinor,$xml.Project.PropertyGroup.VersionBuild))
}
catch
{
throw $_
return
exit 1
}
}
else
Expand All @@ -247,7 +247,7 @@ try
catch
{
throw $_
return
exit 1
}

try
Expand All @@ -270,5 +270,5 @@ try
catch
{
throw $_
return
exit 1
}
Binary file modified SBRW.Launcher.Net/SBRW.Launcher.csproj
Binary file not shown.
2 changes: 1 addition & 1 deletion SBRW.Launcher.RunTime/InsiderKit/BuildBeta.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SBRW.Launcher.RunTime.InsiderKit
namespace SBRW.Launcher.RunTime.InsiderKit
{
/// <summary>
/// This is only used for Beta Testers (Treated like a Public Release)
Expand Down
4 changes: 2 additions & 2 deletions SBRW.Launcher.RunTime/InsiderKit/BuildDevelopment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SBRW.Launcher.RunTime.InsiderKit
namespace SBRW.Launcher.RunTime.InsiderKit
{
/// <summary>
/// This is only used for Developers (Bypasses Most Checks)
Expand All @@ -8,7 +8,7 @@ internal class BuildDevelopment
/// <summary>
///
/// </summary>
private static bool Enabled = true;
private static bool Enabled = false;
/// <summary>
/// If User is Opt-In to Use Beta Builds
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions SBRW.Launcher.RunTime/InsiderKit/BuildInformation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SBRW.Launcher.RunTime.LauncherCore.Languages.Visual_Forms;
using SBRW.Launcher.RunTime.LauncherCore.Languages.Visual_Forms;
using SBRW.Launcher.Core.Cache;

namespace SBRW.Launcher.RunTime.InsiderKit
Expand All @@ -9,9 +9,9 @@ public class BuildInformation
/* Current month, day, year (2 digits), and letter! Ex: 12-15-20-A */
/* If a second build gets release within the same day bump letter version up (No R2 or D2)*/

const string DATE = "";
const string TIME = "";
const string TIME_ZONE = "";
const string DATE = "12-13-2023";
const string TIME = "223017";
const string TIME_ZONE = "-08:00";

private static string BUILD { get; set; } = DATE + "-" + TIME + " " + TIME_ZONE;

Expand Down

0 comments on commit 42cd32f

Please sign in to comment.