Skip to content

Commit

Permalink
Merge branch 'main' into cv/01-10-json_deserialization_for_legacy_rea…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
cameronvoell authored Jan 15, 2025
2 parents 76983ce + 9a43174 commit 63609c5
Show file tree
Hide file tree
Showing 35 changed files with 1,979 additions and 1,686 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-protos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.48.0
- uses: bufbuild/buf-setup-action@v1.49.0
- name: Update rust toolchains
run: rustup update
- name: Cache
Expand Down
90 changes: 58 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sha2 = "0.10.8"
sha3 = "0.10.8"
thiserror = "2.0"
tls_codec = "0.4.1"
tokio = { version = "1.35.1", default-features = false }
tokio = { version = "1.43.0", default-features = false }
uuid = "1.10"
vergen-git2 = "1.0.2"
wasm-timer = "0.2"
Expand All @@ -75,6 +75,7 @@ web-time = "1.1"
bincode = "1.3"
console_error_panic_hook = "0.1"
const_format = "0.2"
criterion = { version = "0.5", features = ["html_reports", "async_tokio"] }
diesel = { version = "2.2", default-features = false }
diesel_migrations = { version = "2.2", default-features = false }
dyn-clone = "1"
Expand All @@ -84,6 +85,7 @@ js-sys = "0.3"
libsqlite3-sys = { version = "0.29", features = [
"bundled-sqlcipher-vendored-openssl",
] }
once_cell = "1.2"
openssl = { version = "0.10", features = ["vendored"] }
openssl-sys = { version = "0.9", features = ["vendored"] }
parking_lot = "0.12.3"
Expand All @@ -93,16 +95,11 @@ tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", default-features = false }
trait-variant = "0.1.2"
url = "2.5.0"
wasm-bindgen = "=0.2.99"
wasm-bindgen-futures = "0.4"
wasm-bindgen-test = "0.3.49"
wasm-bindgen = "=0.2.100"
wasm-bindgen-futures = "0.4.50"
wasm-bindgen-test = "0.3.50"
web-sys = "0.3"
zeroize = "1.8"
criterion = { version = "0.5", features = [
"html_reports",
"async_tokio",
]}
once_cell = "1.2"

# Internal Crate Dependencies
xmtp_api_grpc = { path = "xmtp_api_grpc" }
Expand Down
3 changes: 3 additions & 0 deletions bindings_ffi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ LibXMTPSwiftFFI.xcframework

# Ignore any swift files in include/Generated
/include/**/*.swift

# Ignore the generated kotlin files
/src/uniffi/**/*
39 changes: 39 additions & 0 deletions bindings_ffi/gen_kotlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,44 @@ cd $BINDINGS_PATH
make libxmtp-version
cp libxmtp-version.txt src/uniffi/$PROJECT_NAME/

# 1) Replace `return "xmtpv3"` with `return "uniffi_xmtpv3"`
# 2) Replace `value.forEach { (k, v) ->` with `value.iterator().forEach { (k, v) ->`
# in the file xmtpv3.kt
sed -i '' \
-e 's/return "xmtpv3"/return "uniffi_xmtpv3"/' \
-e 's/value\.forEach { (k, v) ->/value.iterator().forEach { (k, v) ->/g' \
"$BINDINGS_PATH/src/uniffi/xmtpv3/xmtpv3.kt"

echo "Replacements done in $XMTP_ANDROID/library/src/main/java/xmtpv3.kt"

cp $BINDINGS_PATH/src/uniffi/xmtpv3/xmtpv3.kt $XMTP_ANDROID/library/src/main/java/xmtpv3.kt
cp $BINDINGS_PATH/src/uniffi/xmtpv3/libxmtp-version.txt $XMTP_ANDROID/library/src/main/java/libxmtp-version.txt

# Read the version number from libxmtp-version file
VERSION=$(head -n 1 libxmtp-version.txt | cut -d' ' -f2 | cut -c1-7)

# Construct the download URL using the version
DOWNLOAD_URL="https://github.com/xmtp/libxmtp/releases/download/kotlin-bindings-${VERSION}/LibXMTPKotlinFFI.zip"

# Remove existing zip file if it exists
rm -f src/uniffi/$PROJECT_NAME/LibXMTPKotlinFFI.zip
rm -rf src/uniffi/$PROJECT_NAME/jniLibs

# Download the zip file
echo "Downloading from: ${DOWNLOAD_URL}"
curl -fL -o ./LibXMTPKotlinFFI.zip "${DOWNLOAD_URL}"

if [ $? -eq 0 ]; then
echo "Successfully downloaded LibXMTPKotlinFFI.zip"
else
echo "Failed to download zip file. Make sure the kotlin bindings GH action for this commit is finished: https://github.com/xmtp/libxmtp/actions/workflows/release-kotlin-bindings.yml"
exit 1
fi

mv ./LibXMTPKotlinFFI.zip src/uniffi/$PROJECT_NAME/
cd src/uniffi/$PROJECT_NAME/
unzip -o LibXMTPKotlinFFI.zip
cd ../../..

cp -r $BINDINGS_PATH/src/uniffi/$PROJECT_NAME/jniLibs/* ~/XMTP/xmtp-android/library/src/main/jniLibs

Loading

0 comments on commit 63609c5

Please sign in to comment.