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

Fix kotlin script not copying files to android directory #1258

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
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
29 changes: 26 additions & 3 deletions dev/release-kotlin
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/bin/bash
set -eou pipefail

RED='\033[0;31m'
GREEN='\033[0;32m'
WHITE='\033[0;97m'

NC='\033[0m' # No Color

XMTP_ANDROID="${1:-$(realpath ../xmtp-android)}"
if [ ! -d $XMTP_ANDROID ]; then
echo -e "${RED}xmtp-android directory not detected${NC}"
echo -e "${RED}Ensure directory exists.${NC}"
echo -e "${RED}Ensure \`github.com/xmtp/xmtp_android\` is cloned as a sibling directory or passed as the first argument to this script.${NC}"
exit
fi
echo -e "${GREEN}Android Directory:${NC} $XMTP_ANDROID"

# Local script to release android jniLibs with same environment as CI
if [[ "${OSTYPE}" == "darwin"* ]]; then
if ! which nix &>/dev/null; then
Expand Down Expand Up @@ -31,7 +46,15 @@ for arch in arm64-v8a armeabi-v7a x86 x86_64; do
mv "./bindings_ffi/jniLibs/$arch/$LIBRARY_NAME.so" "./bindings_ffi/jniLibs/$arch/$TARGET_NAME.so"
done

if [[ -n "$1" ]]; then
rm -rf $1/library/src/main/jniLibs
mv "./bindings_ffi/jniLibs" $1/library/src/main
echo -e "${WHITE}jniLib generation successful.${NC}"

read -r -p "$(echo -e $WHITE"Delete existing jniLibs and copy new ones? [y/N] "$NC)" response
response=${response}
if [[ "$response" =~ ^(yes|y)$ ]]
then
rm -rf $XMTP_ANDROID/library/src/main/jniLibs
cp -r "./bindings_ffi/jniLibs" $XMTP_ANDROID/library/src/main
echo "libs copied"
else
echo "done"
fi
Loading