Skip to content

Commit

Permalink
Fix kotlin script not copying files to android directory (#1258)
Browse files Browse the repository at this point in the history
* fix kotlin script

* fix noop workflow
  • Loading branch information
insipx authored Nov 18, 2024
1 parent 3fff4fa commit 40653d6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
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

0 comments on commit 40653d6

Please sign in to comment.