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'