Skip to content
Permalink
Browse files

- ISO 8601 sortable DateTime

  • Loading branch information
cozy1 committed Oct 22, 2019
1 parent 278f62b commit fdb737d5d689aebc37f8e94f9a7e75b53b286c2d
@@ -21,8 +21,8 @@ $Assembly_Informational_Version = "$env:GIT_HASH"
# these will be automatically applied to all AssemblyInfo.cs files by AppVeyor ...
$Assembly_Version = "2.9.2.1"
# $AssemblyConfiguration = "BUILD", "BETA", "RELEASE", or (any other string)
# $AssemblyConfiguration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
$Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
# $AssemblyConfiguration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)
$Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)

Write-Host "- Patching: $Assembly_File"
Write-Host "- AssemblyVersion: $Assembly_Version"
BIN +0 Bytes (100%) RocksmithPreBuild.exe
Binary file not shown.
@@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Globalization;


namespace RocksmithPreBuild
@@ -185,31 +186,34 @@ private static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Cyan;
if (args[2].ToUpper() == "READ")
{
// default AssemblyConfiguration
if (String.IsNullOrEmpty(assemblyConfiguration))
assemblyConfiguration = DateTime.UtcNow.ToString();
// default AssemblyConfiguration sortable ISO8601 DateTime format (yyyy-MM-ddTHH:mm:ss) 2019-10-22T01:33:36
if (line.Contains("APPVEYOR_REPO_COMMIT_TIMESTAMP"))
assemblyConfiguration = DateTime.UtcNow.ToString("s", CultureInfo.InvariantCulture);
else
assemblyConfiguration = GetStringInBetween("\"", "\"", line);

Console.WriteLine(" - Read $Assembly_Configuration: " + assemblyConfiguration);
}
else
{
// convert configuration term 'RELEASE' to empty (blank)
// get the appveyor DateTime environmental variable
if (args[2].ToUpper() == "DATE")
assemblyConfiguration = "$env:APPVEYOR_REPO_COMMIT_TIMESTAMP";
assemblyConfiguration = "$env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)";
else if (args[2].ToUpper() == "NONE")
assemblyConfiguration = "";
else
assemblyConfiguration = (args[2]);

if (args[2].ToUpper() == "DATE")
lines[idx] = "$Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP";
{
lines[idx] = "$Assembly_Configuration = " + assemblyConfiguration;
assemblyConfiguration = DateTime.UtcNow.ToString("s", CultureInfo.InvariantCulture);
}
else
lines[idx] = "$Assembly_Configuration = \"" + assemblyConfiguration + "\"";

File.WriteAllLines(patchAssemblyVersionPath, lines.ToArray());
Console.WriteLine(" - Updated $Assembly_Configuration: " + assemblyConfiguration);
Console.WriteLine(" - Updated $Assembly_Configuration: " + assemblyConfiguration);
}
}
else
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.1")]
[assembly: AssemblyInformationalVersion("b161bb65")]
[assembly: AssemblyConfiguration("10/21/2019 9:24:00 PM")]
[assembly: AssemblyInformationalVersion("278f62ba")]
[assembly: AssemblyConfiguration("2019-10-22T02:02:03")]
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.1")]
[assembly: AssemblyInformationalVersion("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyInformationalVersion("278f62ba")]
[assembly: AssemblyConfiguration("2019-10-22T02:02:03")]
@@ -306,15 +306,14 @@ rem resyncing the commit usual fixes the error
rem there are several alternate usages for RocksmithPreBuild.exe

rem the next cmd is used for normal development mode (default - reuse version information, DateTime.UtcNow written to Assembly.Configuration)

cmd /c "RocksmithPreBuild.exe PREBUILD READ READ" > prebuild.log

rem reset the PatchAssemblyVersion.ps1 $Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
rem cmd /c "RocksmithPreBuild.exe PREBUILD 2.9.2.1 DATE"

rem the next cmd is used for test Auto Update feature by setting git subversion to 00000000
rem cmd /c "RocksmithPreBuild.exe PREBUILD READ READ 00000000"

rem reset the PatchAssemblyVersion.ps1 $Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
rem cmd /c "RocksmithPreBuild.exe PREBUILD 1.2.3.4 DATE"

rem before issuing new (blank, i.e. no version type) make next cmd active and comment out the others
rem cmd /c "RocksmithPreBuild.exe PREBUILD 1.2.3.4 NONE"

@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.1")]
[assembly: AssemblyInformationalVersion("b161bb65")]
[assembly: AssemblyConfiguration("10/21/2019 9:24:00 PM")]
[assembly: AssemblyInformationalVersion("278f62ba")]
[assembly: AssemblyConfiguration("2019-10-22T02:02:03")]
@@ -1,3 +1,3 @@
2.9.2.1
b161bb65
10/21/2019 9:24:00 PM
278f62ba
2019-10-22T02:02:03

0 comments on commit fdb737d

Please sign in to comment.
You can’t perform that action at this time.