-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Abacus and add script to use locally built Abacus (#86)
* Bump Abacus and add script to use locally built Abacus * Usage * Update
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ dependencyResolutionManagement { | |
} | ||
} | ||
} | ||
// mavenLocal() | ||
mavenLocal() | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters