From 5ee1659b130796b84abfd431b2fc9c31a02a228b Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Thu, 30 Aug 2018 14:56:45 +0200 Subject: [PATCH] Add `clean` makefile target to ensure build leftover state is removed. Part of #5563 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 8 +++++--- ci/desktop.groovy | 5 ++--- ci/mobile.groovy | 2 ++ scripts/bundle-status-go.sh | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index db1f97fc01..d12ed049a9 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,10 @@ HELP_FUN = \ # Main targets +clean: ##@prepare Remove all output folders + git clean -qdxf modules/react-native-status/ target/ desktop/modules desktop/node_modules + npm prune + setup: ##@prepare Install all the requirements for status-react ./scripts/setup @@ -33,7 +37,6 @@ prepare: ##@prepare Install dependencies and prepare workspace scripts/prepare-for-platform.sh mobile npm install - prepare-ios: prepare ##@prepare Install iOS specific dependencies mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack cd ios && pod install && cd .. @@ -64,8 +67,7 @@ prod-build-ios: lein prod-build-ios full-prod-build: ##@build build prod for both Android and iOS - ./scripts/bundle-status-go.sh ios - ./scripts/bundle-status-go.sh android + ./scripts/bundle-status-go.sh ios android $(MAKE) prod-build rm -r ./modules/react-native-status/ios/RCTStatus/Statusgo.framework/ 2> /dev/null || true rm ./modules/react-native-status/android/libs/status-im/status-go/local/status-go-local.aar 2> /dev/null diff --git a/ci/desktop.groovy b/ci/desktop.groovy index bc1a9e7d70..9b6e5f29e2 100644 --- a/ci/desktop.groovy +++ b/ci/desktop.groovy @@ -22,10 +22,9 @@ external_fonts = [ def cleanupBuild() { sh """ - rm -rf \\ - node_modules ${packageFolder} \\ - desktop/modules desktop/node_modules + rm -rf ${packageFolder} """ + sh 'make clean' } def cleanupAndDeps() { diff --git a/ci/mobile.groovy b/ci/mobile.groovy index 3e8861eb0e..23f7d01809 100644 --- a/ci/mobile.groovy +++ b/ci/mobile.groovy @@ -34,6 +34,8 @@ def podUpdate() { } def prep(type = 'nightly') { + /* ensure that we start from a known state */ + sh 'make clean' /* select type of build */ switch (type) { case 'nightly': diff --git a/scripts/bundle-status-go.sh b/scripts/bundle-status-go.sh index b37e192115..38353089c5 100755 --- a/scripts/bundle-status-go.sh +++ b/scripts/bundle-status-go.sh @@ -15,6 +15,9 @@ fi set -euf +# Ensure we start with a clean state, so as to e.g., not reuse old native status-go bindings +make clean + for platform in "$@"; do case $platform in ios | android)