Release: eine Zeitmarke fuer Instanz und Manager, damit gemeinsame Assemblies bytegleich bleiben (#588)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-15 11:25:54 +02:00
co-authored by Claude Opus 5
parent 0b6ea73ec1
commit 229cf8ab64
2 changed files with 15 additions and 4 deletions
+7 -2
View File
@@ -1,14 +1,19 @@
<Project>
<Target Name="StampBuildDate" BeforeTargets="CoreCompile">
<!-- BuildTimestamp von aussen festlegbar (#588): deploy/publish.py baut Instanz und
Instanzmanager in zwei Laeufen ins selbe Paket. Mit der Uhrzeit je Uebersetzung
wurden die gemeinsamen Assemblies im zweiten Lauf neu gebaut und waren nicht mehr
bytegleich. WriteOnlyWhenDifferent verhindert das Neuschreiben bei gleicher Marke. -->
<PropertyGroup>
<_BuildTimestamp>$([System.DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss"))</_BuildTimestamp>
<_BuildTimestamp Condition="'$(BuildTimestamp)' != ''">$(BuildTimestamp)</_BuildTimestamp>
<_BuildTimestamp Condition="'$(BuildTimestamp)' == ''">$([System.DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss"))</_BuildTimestamp>
<_BuildTimestampFile>$(IntermediateOutputPath)BuildTimestamp.g.cs</_BuildTimestampFile>
</PropertyGroup>
<WriteLinesToFile
File="$(_BuildTimestampFile)"
Lines="[assembly: System.Reflection.AssemblyMetadata(&quot;BuildDate&quot;, &quot;$(_BuildTimestamp)&quot;)]"
Overwrite="true"
WriteOnlyWhenDifferent="false" />
WriteOnlyWhenDifferent="true" />
<ItemGroup>
<Compile Include="$(_BuildTimestampFile)" />
</ItemGroup>
+8 -2
View File
@@ -30,6 +30,7 @@ import subprocess
import sys
import tempfile
import urllib.request
from datetime import datetime
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
@@ -63,10 +64,15 @@ def publish(rid: str, out_dir: Path) -> None:
shutil.rmtree(out_dir)
out_dir.mkdir(parents=True)
# Eine Zeitmarke fuer beide Publish-Laeufe: Directory.Build.targets stempelt sonst
# jede Uebersetzung mit der aktuellen Uhrzeit, und der zweite Lauf baut Core und
# Licensing mit anderer Marke neu - dieselbe Fassung, aber nicht mehr bytegleich.
stamp = f"-p:BuildTimestamp={datetime.now():%Y-%m-%d %H:%M:%S}"
run([
"dotnet", "publish", str(PROJECT),
"-c", "Release", "-r", rid, "--self-contained", "false",
"-o", str(out_dir), "--nologo", "-v", "q",
"-o", str(out_dir), "--nologo", "-v", "q", stamp,
])
# #588: Der Instanzmanager samt Weboberflaeche gehoert ins selbe Paket. Vorher kam
@@ -80,7 +86,7 @@ def publish(rid: str, out_dir: Path) -> None:
run([
"dotnet", "publish", str(MANAGER_PROJECT),
"-c", "Release", "-r", rid, "--self-contained", "false",
"-o", str(manager_dir), "--nologo", "-v", "q",
"-o", str(manager_dir), "--nologo", "-v", "q", stamp,
])
merge_manager(manager_dir, out_dir)