From 7f5fec0e3e3fe9a857ae3981fc48bdf50fe08567 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Thu, 17 Jun 2021 15:11:14 -0500 Subject: [PATCH] enabling msbuild in ci now that we can fetch needed meta build bits from efrocache --- tools/batools/pcommand.py | 62 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/tools/batools/pcommand.py b/tools/batools/pcommand.py index 2a420fe7..996ddfe0 100644 --- a/tools/batools/pcommand.py +++ b/tools/batools/pcommand.py @@ -847,29 +847,49 @@ def gen_flat_data_code() -> None: def win_ci_binary_build() -> None: """Simple windows binary build for ci.""" - from efrotools.efrocache import get_target + import json import subprocess - get_target('build/prefab/lib/windows/Debug_Win32/' - 'BallisticaCoreGenericInternal.lib') - get_target('build/prefab/lib/windows/Debug_Win32/' - 'BallisticaCoreGenericInternal.pdb') - get_target('ballisticacore-windows/Generic/BallisticaCore.ico') + from efrotools.efrocache import get_target - if bool(False): - subprocess.run( - [ - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' - 'Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe', - 'ballisticacore-windows\\Generic' - '\\BallisticaCoreGeneric.vcxproj', - '-target:Build', - '-property:Configuration=Debug', - '-property:Platform=Win32', - '-property:VisualStudioVersion=16', - ], - check=True, - ) - print('so far so good 4', flush=True) + # We'll need to pull a handfull of things out of efrocache for the + # build to succeed. Normally this would happen through our Makefile + # targets but we can't use them under raw window so we need to just + # hard-code whatever we need here. + needed_targets: Set[str] = { + 'build/prefab/lib/windows/Debug_Win32/' + 'BallisticaCoreGenericInternal.lib', + 'build/prefab/lib/windows/Debug_Win32/' + 'BallisticaCoreGenericInternal.pdb', + 'ballisticacore-windows/Generic/BallisticaCore.ico' + } + + # Look through everything that gets generated by our meta builds + # and pick out anything the compile requires. + with open('src/meta/.meta_manifest_public.json') as infile: + meta_public: List[str] = json.loads(infile.read()) + with open('src/meta/.meta_manifest_private.json') as infile: + meta_private: List[str] = json.loads(infile.read()) + for target in meta_public + meta_private: + if target.startswith('src/ballistica/generated/'): + needed_targets.add(target) + + for target in needed_targets: + get_target(target) + + # Do the thing. + subprocess.run( + [ + 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + 'Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe', + 'ballisticacore-windows\\Generic' + '\\BallisticaCoreGeneric.vcxproj', + '-target:Build', + '-property:Configuration=Debug', + '-property:Platform=Win32', + '-property:VisualStudioVersion=16', + ], + check=True, + ) def genchangelog() -> None: