Skip to content

Commit

Permalink
Update BuildAll.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdanggg2 authored Nov 11, 2024
1 parent 57a1f0b commit 75d9417
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/BuildAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def switch_game(game_code):
print(f"Switching to '{colored(game_code, 'cyan')}'")
subprocess.run([f"{game_code}.bat"], shell=True, check=True)

def build(version: str | None = None):
def build(version_extra: str | None = None):
solution_path = VS_PROJECT_PATH / "D3D9Drv.sln"
configuration = "Release"

Expand All @@ -45,10 +45,10 @@ def build(version: str | None = None):
"-m",
f"-p:Configuration={configuration}",
]
if version:
if version_extra:
# Eww stinky, just shove this in here since the rc has it anyway.
with (VS_PROJECT_PATH / "gamename.h").open("a") as f:
f.write(f'\n#define VERSION_EXTRA "{version}"\n')
f.write(f'\n#define VERSION_EXTRA "{version_extra}"\n')
subprocess.run(build_command, shell=True, check=True)

def zip_build(build_name, version_path):
Expand All @@ -72,11 +72,11 @@ def zip_build(build_name, version_path):
print(f"Zipped at: {zip_file_path}")

parser = argparse.ArgumentParser()
parser.add_argument("-v", "--version", required=False)
parser.add_argument("--version-extra", required=False)
args = parser.parse_args()

if args.version:
version = args.version
if args.version_extra:
version = args.version_extra
else:
version = get_version()

Expand All @@ -96,7 +96,7 @@ def zip_build(build_name, version_path):

for game_code in games_codes:
switch_game(game_code)
build(args.version)
build(args.version_extra)
build_name = f"D3D9DrvRTX-{game_code}-{version}"
zip_build(build_name, version_path)
print()

0 comments on commit 75d9417

Please sign in to comment.