From 14a06f9804fcc837fe28cbec317911a1ca956f03 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 9 Dec 2021 13:46:33 +0100 Subject: [PATCH] BuildRelease.sh: Add an option to build the ipa from local source code copy --- CHANGES.md | 6 +++++- Tools/Release/buildRelease.sh | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 85ac68ccd..d2b81bdf1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,11 @@ 🙌 Improvements -- Upgrade MatrixSDK version ([v0.20.14](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.20.14)). +- Upgrade MatrixSDK version ([v0.20.14](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.20.14)) + +🧱 Build + +- BuildRelease.sh: Add an option to build the ipa from local source code copy ## Changes in 1.6.9 (2021-12-07) diff --git a/Tools/Release/buildRelease.sh b/Tools/Release/buildRelease.sh index 6ac02d462..583b00b62 100755 --- a/Tools/Release/buildRelease.sh +++ b/Tools/Release/buildRelease.sh @@ -21,6 +21,8 @@ TAG=$1 BUILD_DIR="build"/$TAG BUILD_NUMBER=$( date +%Y%m%d%H%M%S ) +# Enable this flag to build the ipa from the current local source code. Not git clone +# LOCAL_SOURCE=true if [ -e $BUILD_DIR ]; then echo "Error: Folder ${BUILD_DIR} already exists" @@ -32,7 +34,17 @@ mkdir -p $BUILD_DIR cd $BUILD_DIR REPO_URL=$(git ls-remote --get-url origin) REPO_NAME=$(basename -s .git $REPO_URL) + +if [ "$LOCAL_SOURCE" = true ]; then +echo "Reuse source code of the local copy..." +rm -rf /tmp/$REPO_NAME +cp -R ../../../.. /tmp/$REPO_NAME +mv /tmp/$REPO_NAME . +else +echo "Git clone $REPO_URL with branch/tag $TAG..." git clone $REPO_URL --depth=1 --branch $TAG +fi + cd $REPO_NAME # Fastlane update @@ -44,7 +56,9 @@ bundle update bundle exec fastlane update_plugins # Use appropriated dependencies according to the current branch +if [ "$LOCAL_SOURCE" != true ]; then bundle exec fastlane point_dependencies_to_same_feature +fi # Build bundle exec fastlane app_store build_number:$BUILD_NUMBER git_tag:$TAG