diff --git a/.gitignore b/.gitignore index 026297f..859c2d0 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ test/SDLOgreApp test/out.dat test/converted.dat test/Loader +test/Dependencies *.log diff --git a/src/Dependencies.cake b/src/Dependencies.cake index 4720570..90aba69 100644 --- a/src/Dependencies.cake +++ b/src/Dependencies.cake @@ -3,20 +3,31 @@ (add-cakelisp-search-directory "Dependencies/cakelisp/runtime") (import &comptime-only "ComptimeHelpers.cake" "BuildTools.cake") +;; Define 'Dependencies-Clone-Only to clone only - useful if you don't want to or cannot use git +;; submodules. For example, gamelib/test clones so I don't need to keep removing the test Dependencies. ;; TODO Pitfall: This will pull master, which we might not know works. We need to specify a branch (defmacro add-dependency-git-submodule (hook-name symbol repository-url string output-directory string) (tokenize-push output (defun-comptime (token-splice hook-name) (manager (& ModuleManager) module (* Module) &return bool) (unless (fileExists (token-splice output-directory)) - (Logf "%s: Automatically adding as submodule from %s\\n\\n" - (token-splice output-directory) (token-splice repository-url)) - (run-process-sequential-or - ("git" "submodule" "add" (token-splice repository-url) (token-splice output-directory)) - (Logf "error: failed to add %s as a git submodule dependency. Are you in a git repository?\\n" - (token-splice output-directory)) - (return false)) + (comptime-cond + ('Dependencies-Clone-Only + (Logf "%s: Cloning from %s. Will NOT be tracked as a submodule\\n\\n" + (token-splice output-directory) (token-splice repository-url)) + (run-process-sequential-or + ("git" "clone" (token-splice repository-url) (token-splice output-directory)) + (Logf "error: failed to clone %s\\n" (token-splice output-directory)) + (return false))) + (true + (Logf "%s: Automatically adding as submodule from %s\\n\\n" + (token-splice output-directory) (token-splice repository-url)) + (run-process-sequential-or + ("git" "submodule" "add" (token-splice repository-url) (token-splice output-directory)) + (Logf "error: failed to add %s as a git submodule dependency. Are you in a git repository?\\n" + (token-splice output-directory)) + (return false)))) - ;; Add its submodules as well + ;; Initialize its submodules, in case it has them (run-process-sequential-or ("git" "submodule" "update" "--init" "--recursive" :in-directory (token-splice output-directory)) (Logf "error: failed to initialize submodules belonging to %s\\n" diff --git a/test/Build.sh b/test/Build.sh index 93b626c..e4e48ff 100755 --- a/test/Build.sh +++ b/test/Build.sh @@ -15,10 +15,11 @@ echo "\n\nOgre\n\n" $CAKELISP src/Config_Linux.cake src/OgreApp.cake || exit $? echo "\n\nSDL Ogre\n\n" $CAKELISP src/Config_Linux.cake src/SDLOgreApp.cake || exit $? + # echo "\n\nAuto Test (Math only)\n\n" # $CAKELISP --execute src/Config_Linux.cake src/AutoTest.cake src/Math.cake || exit $? echo "\n\nAuto Test\n\n" -$CAKELISP src/Config_Linux.cake ../src/AutoTest.cake ../src/SDL.cake ../src/Math.cake ../src/Aubio.cake || exit $? +$CAKELISP --execute src/Config_Linux.cake ../src/AutoTest.cake ../src/SDL.cake ../src/Math.cake ../src/Aubio.cake || exit $? # $CAKELISP src/Config_Linux.cake ../src/AutoTest.cake ../src/SDL.cake ../src/Tracy.cake ../src/Math.cake ../src/Aubio.cake || exit $? echo "\n\nVocal Game (hot reload)\n\n" diff --git a/test/src/Config_Linux.cake b/test/src/Config_Linux.cake index eda31e5..0c8b62a 100644 --- a/test/src/Config_Linux.cake +++ b/test/src/Config_Linux.cake @@ -2,3 +2,6 @@ (comptime-define-symbol 'Unix) ;; Building from test/, need to go up one into gamelib (a bit unusual) (add-cakelisp-search-directory "../src") + +;; Need to define this to not have to manually delete dependencies after testing is done +(comptime-define-symbol 'Dependencies-Clone-Only)