Skip to content

Commit

Permalink
cb6cd: build_all.py: extracted build scripts for each sample
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Dec 24, 2024
1 parent 3d2af96 commit 9e1967e
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 36 deletions.
39 changes: 3 additions & 36 deletions build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,48 +98,15 @@ def run_per_platform(cmds_windows=[], cmds_macOS=[], cmds_linux=[], cwd='.'):

# physTest sample
if 'physTest' in BUILD_PROJECTS:
proj_dir = 'prog/samples/physTest'
if 'code' in BUILD_COMPONENTS:
run('jam', cwd=proj_dir)
run(['jam', '-f', 'jamfile-test-jolt'], cwd=proj_dir)
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_game_shaders-dx11.bat', 'compile_game_shaders-metal.bat', 'compile_game_shaders-spirv.bat'],
cmds_macOS = ['./compile_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh'],
cwd=proj_dir+'/shaders')
run([sys.executable, './build.py'] + PY_ADD_CMDLINE, cwd='prog/samples/physTest')

# skiesSample
if 'skiesSample' in BUILD_PROJECTS:
proj_dir = 'samples/skiesSample/prog'
print('=== building '+proj_dir);
if 'code' in BUILD_COMPONENTS:
run('jam', cwd=proj_dir)
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_shaders_dx12.bat', 'compile_shaders_dx11.bat', 'compile_shaders_metal.bat', 'compile_shaders_spirv.bat',
'compile_shaders_tools.bat'],
cmds_macOS = ['./compile_shaders_metal.sh', './compile_tool_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh', './compile_tool_shaders_spirv.sh'],
cwd=proj_dir+'/shaders')
if 'assets' in BUILD_COMPONENTS:
run(DABUILD_CMD + ['../application.blk'], cwd='samples/skiesSample/develop')
run([sys.executable, './build.py'] + PY_ADD_CMDLINE, cwd='samples/skiesSample/prog')

# testGI sample
if 'testGI' in BUILD_PROJECTS:
proj_dir = 'samples/testGI/prog'
print('=== building '+proj_dir);
if 'code' in BUILD_COMPONENTS:
run('jam', cwd=proj_dir)
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_shaders_dx12.bat', 'compile_shaders_dx11.bat', 'compile_shaders_metal.bat', 'compile_shaders_spirv.bat',
'compile_shaders_tools.bat'],
cmds_macOS = ['./compile_shaders_metal.sh', './compile_tool_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh', './compile_tool_shaders_spirv.sh'],
cwd=proj_dir+'/shaders')
if 'assets' in BUILD_COMPONENTS:
run(DABUILD_CMD + ['../application.blk'], cwd='samples/testGI/develop')
run([sys.executable, './build.py'] + PY_ADD_CMDLINE, cwd='samples/testGI/prog')

# Outer Space game sample
if 'outerSpace' in BUILD_PROJECTS:
Expand Down
19 changes: 19 additions & 0 deletions prog/samples/physTest/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import sys
sys.path.append('../../..')
from build_all import run, run_per_platform, BUILD_COMPONENTS
sys.path.pop()


# build EXE
if 'code' in BUILD_COMPONENTS:
run('jam')
run(['jam', '-f', 'jamfile-test-jolt'])

# build shaders
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_game_shaders-dx11.bat', 'compile_game_shaders-metal.bat', 'compile_game_shaders-spirv.bat'],
cmds_macOS = ['./compile_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh'],
cwd='./shaders')
23 changes: 23 additions & 0 deletions samples/skiesSample/prog/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
import sys
sys.path.append('../../..')
from build_all import run, run_per_platform, DABUILD_CMD, BUILD_COMPONENTS
sys.path.pop()


# build EXE
if 'code' in BUILD_COMPONENTS:
run('jam')

# build shaders
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_shaders_dx12.bat', 'compile_shaders_dx11.bat', 'compile_shaders_metal.bat', 'compile_shaders_spirv.bat',
'compile_shaders_tools.bat'],
cmds_macOS = ['./compile_shaders_metal.sh', './compile_tool_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh', './compile_tool_shaders_spirv.sh'],
cwd='./shaders')

# dabuild assets
if 'assets' in BUILD_COMPONENTS:
run(DABUILD_CMD + ['../application.blk'], cwd='../develop')
23 changes: 23 additions & 0 deletions samples/testGI/prog/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
import sys
sys.path.append('../../..')
from build_all import run, run_per_platform, DABUILD_CMD, BUILD_COMPONENTS
sys.path.pop()


# build EXE
if 'code' in BUILD_COMPONENTS:
run('jam')

# build shaders
if 'shaders' in BUILD_COMPONENTS:
run_per_platform(
cmds_windows = ['compile_shaders_dx12.bat', 'compile_shaders_dx11.bat', 'compile_shaders_metal.bat', 'compile_shaders_spirv.bat',
'compile_shaders_tools.bat'],
cmds_macOS = ['./compile_shaders_metal.sh', './compile_tool_shaders_metal.sh'],
cmds_linux = ['./compile_shaders_spirv.sh', './compile_tool_shaders_spirv.sh'],
cwd='./shaders')

# dabuild assets
if 'assets' in BUILD_COMPONENTS:
run(DABUILD_CMD + ['../application.blk'], cwd='../develop')

0 comments on commit 9e1967e

Please sign in to comment.