From 3bb6d7d199b2d1619960d320124b8acf123802fc Mon Sep 17 00:00:00 2001 From: James Tucker Date: Mon, 7 Aug 2023 16:13:19 -0700 Subject: [PATCH] Makefile: add destructivepurge action for cleaning up a development machine Sometimes gradle and friends get themselves stuck with cached configuration. This provides an action that takes a sometimes more effective route to eradicating those problems. --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b7b4cf..8ad3e9d 100644 --- a/Makefile +++ b/Makefile @@ -168,4 +168,13 @@ clean: -rm -rf android/build $(DEBUG_APK) $(RELEASE_AAB) $(AAR) tailscale-fdroid.apk -pkill -f gradle -.PHONY: all clean install android/lib $(DEBUG_APK) $(RELEASE_AAB) $(AAR) release bump_version dockershell +# destructivepurge removes all downloaded Android SDK packages, gradle caches, +# build artifacts and other bits that might influence build behavior, ~everything +# except Android Studio. +destructivepurge: clean + -git clean -fdx + -if [ -d $(ANDROID_HOME) ]; then rm -rf $(ANDROID_HOME); fi + -if [ -d $(HOME)/.gradle ]; then rm -rf $(HOME)/.gradle; fi + -rm -rf $(HOME)/.cache/tailscale-android* + +.PHONY: all clean destructivepurge install android/lib $(DEBUG_APK) $(RELEASE_AAB) $(AAR) release bump_version dockershell