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
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
5 changes: 0 additions & 5 deletions .github/workflows/noop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: No Op

on:
pull_request:
# ignore code and some workflow changes
Expand All @@ -13,7 +12,6 @@ on:
- "!.github/workflows/test-workspace.yml"
- "!bindings_ffi/**"
- "!bindings_node/**"
- "!dev/**"
- "!mls_validation_service/**"
- "!xmtp_api_grpc/**"
- "!xmtp_cryptography/**"
Expand All @@ -26,18 +24,15 @@ on:
- "!Cargo.lock"
- "!rust-toolchain"
- "!rustfmt.toml"

# Test and Lint steps are required for pull requests, but some file changes
# don't require them to run. These jobs define the required steps for these
# cases, but don't actually do anything.

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- run: echo "Nothing to test"

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
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