Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Abacus and add script to use locally built Abacus #86

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading