Skip to content

Commit

Permalink
Bump Abacus and add script to use locally built Abacus (#86)
Browse files Browse the repository at this point in the history
* Bump Abacus and add script to use locally built Abacus

* Usage

* Update
  • Loading branch information
ruixhuang authored Apr 26, 2024
1 parent 33ba783 commit 04852bf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions scripts/build_abacus_local.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencyResolutionManagement {
}
}
}
// mavenLocal()
mavenLocal()
}
}

Expand Down
2 changes: 1 addition & 1 deletion v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 04852bf

Please sign in to comment.