Skip to content

Commit

Permalink
refac: restructure repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed May 22, 2024
1 parent 6780c65 commit 7eec1af
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 39 deletions.
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ body:
label: System
options:
- New
- Core
- OS
- Drawing
- User Interface
- Logging
- Profiling
- Data structures
- Memory
- ECS
- Job
- Stats
- Image
- Allocators
- Testing
- Operating system services
- Input & Output
- Build
- Graphics
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
set VULKAN_SDK=C:\VulkanSDK\1.3.224.1
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python gen_build.py
python gen_examples.py
cd ../src
Expand All @@ -68,14 +68,14 @@ jobs:
if not exist ../out/pl_ref_renderer_ext.dll exit 1
if not exist ../out/pl_draw_ext.dll exit 1
if not exist ../out/pl_ui_ext.dll exit 1
if not exist ../out/pl_camera_script.dll exit 1
if not exist ../out/pl_script_camera.dll exit 1
if not exist ../out/pilotlight.lib exit 1
- name: Package Pilot Light
shell: cmd
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python package.py
- name: Upload Pilot Light
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Build Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 gen_build.py
python3 gen_examples.py
cd ../src
Expand Down Expand Up @@ -133,13 +133,13 @@ jobs:
test -f ./out/pl_ref_renderer_ext.dylib || exit 1
test -f ./out/pl_draw_ext.dylib || exit 1
test -f ./out/pl_ui_ext.dylib || exit 1
test -f ./out/pl_camera_script.dylib || exit 1
test -f ./out/pl_script_camera.dylib || exit 1
test -f ./out/pilotlight.a || exit 1
- name: Package Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 package.py
- name: Upload Pilot Light
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
- name: Build Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 gen_build.py
python3 gen_examples.py
cd ../src
Expand Down Expand Up @@ -211,13 +211,13 @@ jobs:
test -f ./out/pl_ref_renderer_ext.so || exit 1
test -f ./out/pl_draw_ext.so || exit 1
test -f ./out/pl_ui_ext.so || exit 1
test -f ./out/pl_camera_script.so || exit 1
test -f ./out/pl_script_camera.so || exit 1
test -f ./out/pilotlight.a || exit 1
- name: Package Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 package.py
pwd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-build-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: |
cd %GITHUB_WORKSPACE%
echo ${{ github.event.inputs.version }} > version_number.txt
ren build pilotlight_build
ren pl_build pilotlight_build
cd pilotlight_build
cd ..
move pilotlight_build\deploy_setup.py deploy_setup.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
echo "You may use a free license. More information at https://www.viva64.com/en/b/0457/"
exit 0
fi
cd tools
cd scripts
python3 gen_build.py
cd ../src
chmod +x build.sh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
shell: cmd
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python gen_tests.py
cd ../tests
call build.bat -c debug
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Run Tests
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 gen_tests.py
cd ../tests
chmod +x build.sh
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Run Tests
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 gen_tests.py
cd ../tests
chmod +x build.sh
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data/
out/

# python
build/__pycache__/
pl_build/__pycache__/

# debug files
src/*.pdb
Expand Down
2 changes: 1 addition & 1 deletion apps/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
ptAppData->tMainCamera = gptEcs->create_perspective_camera(ptMainComponentLibrary, "main camera", (plVec3){-9.6f, 2.096f, 0.86f}, PL_PI_3, ptIO->afMainViewportSize[0] / ptIO->afMainViewportSize[1], 0.1f, 30.0f, &ptMainCamera);
gptCamera->set_pitch_yaw(ptMainCamera, -0.245f, 1.816f);
gptCamera->update(ptMainCamera);
gptEcs->attach_script(ptMainComponentLibrary, "pl_camera_script", PL_SCRIPT_FLAG_PLAYING, ptAppData->tMainCamera, NULL);
gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camera", PL_SCRIPT_FLAG_PLAYING, ptAppData->tMainCamera, NULL);

// create cull camera
plCameraComponent* ptCullCamera = NULL;
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Next:
### Windows
Example for running example 0:
```bash
cd pilotlight/tools
cd pilotlight/scripts
python gen_examples.py
cd ../examples
build.bat
Expand All @@ -19,7 +19,7 @@ pilot_light.exe -a example_0
### MacOS & Linux
Example for running example 0:
```bash
cd pilotlight/tools
cd pilotlight/scripts
python3 gen_examples.py
cd ../examples
chmod +x build.sh
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pl_script_run(plComponentLibrary* ptLibrary, plEntity tEntity)
static const char*
pl_script_name(void)
{
return "pl_camera_script";
return "pl_script_camera";
}

//-----------------------------------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build/deploy_setup.py → pl_build/deploy_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def readme():
description='Pilot Light Build',
long_description=readme(),
long_description_content_type="text/markdown",
url='https://github.com/hoffstadt/pilotlight-build', # Optional
url='https://github.com/PilotLightTech/pilotlight', # Optional
packages=['pilotlight_build'],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions tools/gen_build.py → scripts/gen_build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build")
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build")

import pl_build as pl

Expand Down Expand Up @@ -76,7 +76,7 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None,
pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C)

pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS")
pl.push_include_directories("../apps", "../src", "../ui", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down Expand Up @@ -118,15 +118,15 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None,
add_plugin_to_vulkan_app("pl_draw_ext", True)
add_plugin_to_vulkan_app("pl_debug_ext", False)
add_plugin_to_vulkan_app("pl_image_ext", False)
add_plugin_to_vulkan_app("pl_vulkan_ext", False, "pl_graphics_ext")
add_plugin_to_vulkan_app("pl_graphics_vulkan", False, "pl_graphics_ext")
add_plugin_to_vulkan_app("pl_stats_ext", False)
add_plugin_to_vulkan_app("pl_job_ext", False)
add_plugin_to_vulkan_app("pl_model_loader_ext", False)
add_plugin_to_vulkan_app("pl_ecs_ext", True)
add_plugin_to_vulkan_app("pl_resource_ext", False)
add_plugin_to_vulkan_app("pl_gpu_allocators_ext", False)
add_plugin_to_vulkan_app("pl_ref_renderer_ext", True)
add_plugin_to_vulkan_app("pl_ui_ext", True, None, "../ui/")
add_plugin_to_vulkan_app("pl_ui_ext", True, None)

add_plugin_to_metal_app("pl_draw_ext", True)
add_plugin_to_metal_app("pl_debug_ext", False)
Expand All @@ -136,14 +136,14 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None,
add_plugin_to_metal_app("pl_ecs_ext", True)
add_plugin_to_metal_app("pl_model_loader_ext", False)
add_plugin_to_metal_app("pl_resource_ext", False)
add_plugin_to_metal_app("pl_metal_ext", False, True, "pl_graphics_ext")
add_plugin_to_metal_app("pl_graphics_metal", False, True, "pl_graphics_ext")
add_plugin_to_metal_app("pl_gpu_allocators_ext", False)
add_plugin_to_metal_app("pl_ref_renderer_ext", True)
add_plugin_to_metal_app("pl_ui_ext", True, False, None, "../ui/")
add_plugin_to_metal_app("pl_ui_ext", True, False, None)

# scripts
add_plugin_to_vulkan_app("pl_camera_script", False, None, "../scripts/")
add_plugin_to_metal_app("pl_camera_script", False, False, None, "../scripts/")
add_plugin_to_vulkan_app("pl_script_camera", False, None)
add_plugin_to_metal_app("pl_script_camera", False, False, None)

pl.pop_target_links()

Expand Down
4 changes: 2 additions & 2 deletions tools/gen_examples.py → scripts/gen_examples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build")
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build")

import pl_build as pl

Expand Down Expand Up @@ -51,7 +51,7 @@ def add_example_app(name):
pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C)

pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS")
pl.push_include_directories("../apps", "../examples", "../src", "../ui", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_include_directories("../apps", "../examples", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down
4 changes: 2 additions & 2 deletions tools/gen_tests.py → scripts/gen_tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build")
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build")

import pl_build as pl

Expand All @@ -21,7 +21,7 @@
pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C)

pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS")
pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../backends", "../out", "../dependencies/pilotlight-libs", "../dependencies/stb")
pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down
26 changes: 22 additions & 4 deletions tools/package.py → scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

target_directory = "../out/pilotlight"

# extensions
extensions = [
"pl_debug_ext",
"pl_graphics_ext",
"pl_image_ext",
"pl_ecs_ext",
"pl_stats_ext",
Expand All @@ -23,7 +23,14 @@
"pl_ref_renderer_ext",
"pl_gpu_allocators_ext",
"pl_model_loader_ext",
"pl_draw_ext"
"pl_draw_ext",
"pl_graphics_ext",
"pl_ui_ext"
]

# scripts
scripts = [
"pl_script_camera"
]

if os.path.isdir(target_directory):
Expand Down Expand Up @@ -53,11 +60,12 @@
shutil.copy("../src/pl_config.h", target_directory + "/include/pl_config.h")
shutil.copy("../src/pl_os.h", target_directory + "/include/pl_os.h")

# copy extension headers
# copy simple extension headers
for extension in extensions:
shutil.copy("../extensions/" + extension + ".h", target_directory + "/include/" + extension + ".h")

# special headers
shutil.copy("../extensions/pl_script_ext.h", target_directory + "/include/pl_script_ext.h")
shutil.copy("../ui/pl_ui_ext.h", target_directory + "/include/pl_ui_ext.h")

# copy pilotlight-lib headers
shutil.copy("../libs/pl_ds.h", target_directory + "/include/pl_ds.h")
Expand All @@ -82,6 +90,16 @@
elif platform.system() == "Linux":
shutil.copy("../out/" + extension + ".so", target_directory + "/bin/" + extension + ".so")

# copy scripts
for script in scripts:
if platform.system() == "Windows":
shutil.copy("../out/" + script + ".dll", target_directory + "/bin/" + script + ".dll")
elif platform.system() == "Darwin":
shutil.copy("../out/" + script + ".dylib", target_directory + "/bin/" + script + ".dylib")
shutil.copytree("../out/" + script + ".dylib.dSYM", target_directory + "/bin/" + script + ".dylib.dSYM")
elif platform.system() == "Linux":
shutil.copy("../out/" + script + ".so", target_directory + "/bin/" + script + ".so")

# copy libs & executable
if platform.system() == "Windows":
shutil.copy("../out/pilot_light.exe", target_directory + "/bin/pilot_light.exe")
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"${workspaceFolder}/**",
"${workspaceFolder}/apps",
"${workspaceFolder}/src",
"${workspaceFolder}/ui",
"${workspaceFolder}/libs",
"${workspaceFolder}/extensions",
"${workspaceFolder}/dependencies/stb",
Expand Down

0 comments on commit 7eec1af

Please sign in to comment.