From f02c572618bdca669c61cd3cb51a8b85e0fc6657 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 8 May 2014 14:25:36 -0700 Subject: [PATCH 1/3] clear xcode caches if they appear older than a day - refs #174 --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c16c3f87c..c1310d155 100644 --- a/Makefile +++ b/Makefile @@ -51,18 +51,21 @@ run-linux: linux ##### Xcode projects ########################################################### +clear_xcode_cache: + @if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]]; then echo 'clearing files in xcode cache older than one day'; find ~/Library/Developer/Xcode/DerivedData/* -mtime +1 | xargs rm -rf; fi + # build Mac OS X project for Xcode -xproj: config.gypi macosx/llmr-app.gyp +xproj: config.gypi macosx/llmr-app.gyp clear_xcode_cache deps/run_gyp macosx/llmr-app.gyp --depth=. --generator-output=./build -f xcode open ./build/macosx/llmr-app.xcodeproj # build iOS project for Xcode -iproj: config.gypi ios/llmr-app.gyp +iproj: config.gypi ios/llmr-app.gyp clear_xcode_cache deps/run_gyp ios/llmr-app.gyp --depth=. --generator-output=./build -f xcode open ./build/ios/llmr-app.xcodeproj # build Linux project for Xcode (Runs on Mac OS X too, but without platform-specific code) -lproj: config.gypi linux/llmr-app.gyp +lproj: config.gypi linux/llmr-app.gyp clear_xcode_cache deps/run_gyp linux/llmr-app.gyp --depth=. --generator-output=./build -f xcode open ./build/linux/llmr-app.xcodeproj From 53decedf85b847d41f067c3a2194c65eb4ccc1db Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 9 May 2014 14:08:58 -0700 Subject: [PATCH 2/3] more selective cache clear --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1310d155..fd4d7d02b 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ run-linux: linux ##### Xcode projects ########################################################### clear_xcode_cache: - @if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]]; then echo 'clearing files in xcode cache older than one day'; find ~/Library/Developer/Xcode/DerivedData/* -mtime +1 | xargs rm -rf; fi + @if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]]; then echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/ older than one day'; find ~/Library/Developer/Xcode/DerivedData/llmr-app-* -mtime +1 | xargs rm -rf; fi # build Mac OS X project for Xcode xproj: config.gypi macosx/llmr-app.gyp clear_xcode_cache From 854de240553e3b0cea428339acb38c5a6c5f8f9d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 13 May 2014 12:12:12 -0700 Subject: [PATCH 3/3] push improvement for smart cache clearing from @wsnook --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c83d2e694..c11b64160 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,17 @@ run-linux: linux ##### Xcode projects ########################################################### +clear_xcode_cache: + @CUSTOM_DD=`defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation 2>/dev/null`; \ + if [[ $$CUSTOM_DD ]]; then \ + echo clearing files in $$CUSTOM_DD older than one day; \ + find $$CUSTOM_DD/llmr-app-* -mtime +1 | xargs rm -rf; \ + fi; \ + if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]] && [[ ! $$CUSTOM_DD ]]; then \ + echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/llmr-app-* older than one day'; \ + find ~/Library/Developer/Xcode/DerivedData/llmr-app-* -mtime +1 | xargs rm -rf; \ + fi + clear_xcode_cache: @if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]]; then echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/ older than one day'; find ~/Library/Developer/Xcode/DerivedData/llmr-app-* -mtime +1 | xargs rm -rf; fi @@ -74,13 +85,12 @@ lproj: config.gypi linux/llmr-app.gyp clear_xcode_cache node ##### Maintenace operations #################################################### -clean: +clean: clear_xcode_cache -rm -rf ./build/Release -rm -rf ./build/Debug -rm -f include/llmr/shader/shaders.hpp -rm -f include/llmr/style/resources.hpp -rm -f src/style/resources.cpp - -rm -rf ~/Library/Developer/Xcode/DerivedData/llmr* distclean: clean -rm -rf ./build