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:
@@ -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("BuildDate", "$(_BuildTimestamp)")]"
|
||||
Overwrite="true"
|
||||
WriteOnlyWhenDifferent="false" />
|
||||
WriteOnlyWhenDifferent="true" />
|
||||
<ItemGroup>
|
||||
<Compile Include="$(_BuildTimestampFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
+8
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user