From 804a5387ce179d90a03cd1e714855d45e8399fd7 Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Sat, 15 Feb 2025 10:33:33 -0500 Subject: [PATCH] [Linux/Mac] Updated RunExamplesLinux.sh/MacOS.command scripts to include 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 RunExamplesMacOS.command scripts to automatically find all available example projects to run. --- RunExamplesLinux.sh | 8 +++++--- RunExamplesMacOS.command | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RunExamplesLinux.sh b/RunExamplesLinux.sh index 0edd529606..598906d7a7 100755 --- a/RunExamplesLinux.sh +++ b/RunExamplesLinux.sh @@ -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 diff --git a/RunExamplesMacOS.command b/RunExamplesMacOS.command index a0aea842dc..7d851c3022 100755 --- a/RunExamplesMacOS.command +++ b/RunExamplesMacOS.command @@ -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