From 04852bfd94cc37047bbf08c4920bd56b04da64f4 Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:24:21 -0700 Subject: [PATCH] Bump Abacus and add script to use locally built Abacus (#86) * Bump Abacus and add script to use locally built Abacus * Usage * Update --- scripts/build_abacus_local.sh | 42 +++++++++++++++++++++++++++++++++++ settings.gradle | 2 +- v4/build.gradle | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 scripts/build_abacus_local.sh diff --git a/scripts/build_abacus_local.sh b/scripts/build_abacus_local.sh new file mode 100755 index 00000000..ac38d3d0 --- /dev/null +++ b/scripts/build_abacus_local.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# This script is used to build the abacus project locally. +# +# Please run this after making local change to the abacus project. The change will be +# picked up by the v4-native-android project (via the local maven repository). Note that +# the script needs to be run everytime a change is made to the abacus project. +# +# The script will update both the v4-abacus and v4-native-android repositories, so please make sure +# you clean-up/revert the changes after you are done with the local testing + +ABACUS_DIR=~/v4-abacus +ANDROID_DIR=~/v4-native-android + +# Create a random version number +NEW_VERSION="local.$(date +%s)" + +# search for the first line that starts with "version" in build.gradle.kts +# get the value in the quotes +VERSION=$(grep "^version = " ${ABACUS_DIR}/build.gradle.kts | sed -n 's/version = "\(.*\)"/\1/p') + +sed -i '' "s/version = \"$VERSION\"/version = \"$NEW_VERSION\"/" ${ABACUS_DIR}/build.gradle.kts +echo "Version bumped to $NEW_VERSION" + +echo "Building Abacus ..." + +cd ${ABACUS_DIR} +./gradlew publishToMavenLocal + +cd ${ANDROID_DIR} + +# get the version from the file +targetFileName="v4/build.gradle" +OLD_VERSION=$(grep "^ abacusVersion = " $targetFileName | sed -n 's/ abacusVersion = ''\(.*\)''/\1/p') + +if [ -n "$NEW_VERSION" ] && [ -n "$OLD_VERSION" ]; then + echo "Bumping Abacus version from $OLD_VERSION to $NEW_VERSION" + sed -i '' "s/^ abacusVersion = $OLD_VERSION/ abacusVersion = '$NEW_VERSION'/" $targetFileName + echo "Version bumped to $NEW_VERSION" +else + echo "No version found" +fi \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index faed481d..2f9a08cd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -40,7 +40,7 @@ dependencyResolutionManagement { } } } - // mavenLocal() + mavenLocal() } } diff --git a/v4/build.gradle b/v4/build.gradle index 96438662..0bd53f24 100644 --- a/v4/build.gradle +++ b/v4/build.gradle @@ -89,7 +89,7 @@ ext { compileSdkVersion = 34 // App dependencies - abacusVersion = '1.6.40' + abacusVersion = '1.6.46' carteraVersion = '0.1.13' kollectionsVersion = '2.0.16'