From 05c67eefbd2627f04fb8de2b3f1dad86a6193422 Mon Sep 17 00:00:00 2001
From: Li
Date: Sun, 8 May 2022 12:51:39 +1200
Subject: [PATCH] Update made automatically due to pressing build
---
.../LibHISP/Properties/AssemblyInfo.cs | 5 ++---
HorseIsleServer/prebuild.py | 15 +++++++++++++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs
index 313aac9..e069b96 100644
--- a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs
+++ b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs
@@ -4,10 +4,10 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("HISP")]
+[assembly: AssemblyTitle("LibHISP")]
[assembly: AssemblyDescription("Server Emulator for \"Horse Isle\"")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("SilicaAndPina")]
+[assembly: AssemblyCompany("Li")]
[assembly: AssemblyProduct("HISP")]
[assembly: AssemblyCopyright("Public Domain © 2022")]
[assembly: AssemblyTrademark("")]
@@ -30,6 +30,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
diff --git a/HorseIsleServer/prebuild.py b/HorseIsleServer/prebuild.py
index a8845e8..edd1c26 100644
--- a/HorseIsleServer/prebuild.py
+++ b/HorseIsleServer/prebuild.py
@@ -5,6 +5,8 @@ import time
import datetime
import binascii
+# Determine git stuff.
+
global commit_hash
global commit_tag
global commit_branch
@@ -37,4 +39,17 @@ open(os.path.join(versioning_folder, "GitBranch"), "w").write(commit_branch)
open(os.path.join(versioning_folder, "BuildDate"), "w").write(commit_date)
open(os.path.join(versioning_folder, "BuildTime"), "w").write(commit_time)
+# Derive assembly version
+points = commit_tag.replace("v", "").split(".")
+while len(points) < 4:
+ points.append("0")
+assembly_version = ".".join(points)
+assembly_info = os.path.join("LibHISP", "Properties", "AssemblyInfo.cs")
+lines = open(assembly_info, "r").readlines()
+for line in lines:
+ if line.startswith("[assembly: AssemblyVersion(\""):
+ line = "[assembly: AssemblyVersion(\""+assembly_version+"\")]"
+ if line.startswith("[assembly: AssemblyVersion(\""):
+ line = "[assembly: AssemblyFileVersion(\""+assembly_version+"\")]"
+open(assembly_info, "w").writelines(lines)
\ No newline at end of file