Skip to content

Commit

Permalink
[Linux/Mac] Updated RunExamplesLinux.sh/Mac.command scripts to includ…
Browse files Browse the repository at this point in the history
…e new file pattern for examples.

New examples should use their project name for their main source file.
All existing Example.cpp files will eventually be renamed to their respective project names.
This change includes this new pattern in the RunExamplesLinux.sh and RunExamplesMac.command scripts
to automatically find all available example projects to run.
  • Loading branch information
LukasBanana committed Feb 15, 2025
1 parent 9636793 commit e6d00c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions RunExamplesLinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ fi

list_examples()
{
EXCLUDED=(MultiRenderer MultiThreading PBR ComputeShader)
EXCLUDED=(MultiRenderer) # List any examples that are specifically excluded on Linux
EXAMPLE_DIRS=($(ls examples/Cpp))
for DIR in "${EXAMPLE_DIRS[@]}"; do
if ! echo "${EXCLUDED[@]}}" | grep -qw "$DIR"; then
# Include example if its source and binary files exist
if [ -f "examples/Cpp/$DIR/Example.cpp" ] && [ -f "$BUILD_DIR/Example_$DIR" -o -f "$BUILD_DIR/Example_${DIR}D" ]; then
echo "$DIR"
if [ -f "examples/Cpp/$DIR/Example.cpp" ] || [ -f "examples/Cpp/$DIR/$DIR.cpp" ]; then
if [ -f "$BUILD_DIR/Example_$DIR" ] || [ -f "$BUILD_DIR/Example_${DIR}D" ]; then
echo "$DIR"
fi
fi
fi
done
Expand Down
6 changes: 4 additions & 2 deletions RunExamplesMacOS.command
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ list_examples()
for DIR in "${EXAMPLE_DIRS[@]}"; do
if ! echo "${EXCLUDED[@]}}" | grep -qw "$DIR"; then
# Include example if its source and binary files exist
if [ -f "examples/Cpp/$DIR/Example.cpp" ] && [ -f "$BUILD_DIR/Example_${DIR}.app/Contents/MacOS/Example_${DIR}" ]; then
echo "$DIR"
if [ -f "examples/Cpp/$DIR/Example.cpp" ] || [ -f "examples/Cpp/$DIR/$DIR.cpp" ]; then
if [ -f "$BUILD_DIR/Example_${DIR}.app/Contents/MacOS/Example_${DIR}" ]; then
echo "$DIR"
fi
fi
fi
done
Expand Down

0 comments on commit e6d00c4

Please sign in to comment.