Files
praxisandClaude Fable 5.2 8a24c445b0 Content pipeline and operator tools
367 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

23 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Build the local DB2 reader using installed reference assemblies, without NuGet."""
from pathlib import Path
import json
import hashlib
import subprocess
ROOT=Path(__file__).resolve().parents[1]
def main():
output=ROOT/'build/db2-gameplay';output.mkdir(parents=True,exist_ok=True)
sdk=sorted(Path('/usr/share/dotnet/sdk').glob('*/Roslyn/bincore/csc.dll'))[-1]
refs=sorted(Path('/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref').glob('*/ref/net10.0'))[-1]
libraries=Path.home()/'Projects/WoW-Hybrid/tools/DB2Inspector/bin/Debug/net10.0'
args=['dotnet',str(sdk),'-nologo','-target:exe','-out:'+str(output/'DB2Gameplay.dll')]
args+=['-r:'+str(p) for p in refs.glob('*.dll')]
args+=['-r:'+str(libraries/name) for name in ('DBCD.dll','DBCD.IO.dll','DBDefsLib.dll')]
subprocess.run([*args,str(ROOT/'ops/gameplay_db2_export.cs')],check=True)
import shutil
for name in ('DBCD.dll','DBCD.IO.dll','DBDefsLib.dll'):shutil.copy2(libraries/name,output/name)
(output/'DB2Gameplay.runtimeconfig.json').write_text(json.dumps({'runtimeOptions':{'tfm':'net10.0','framework':{'name':'Microsoft.NETCore.App','version':'10.0.0'}}}))
(output/'source.sha256').write_text(hashlib.sha256((ROOT/'ops/gameplay_db2_export.cs').read_bytes()).hexdigest()+'\n')
print('Built local source-schema DB2 reader without restoring packages.')
if __name__=='__main__':main()