Skip to content

Commit

Permalink
update process for updating from libxmtp (#367)
Browse files Browse the repository at this point in the history
* update process for updating from libxmtp

* clarify steps

---------

Co-authored-by: cameronvoell <[email protected]>
  • Loading branch information
cameronvoell and cameronvoell authored Jan 14, 2025
1 parent 4b9d152 commit 2da80a0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions library/src/main/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ Kotlin code emitted by the `bindings_ffi` crate in [libxmtp](https://github.com/

## Process for updating from a [libxmtp](https://github.com/xmtp/libxmtp) Kotlin Binding Release

1. From repo [libxmtp](https://github.com/xmtp/libxmtp) run the [kotlin release action](https://github.com/xmtp/libxmtp/actions/workflows/release-kotlin-bindings.yml) for the branch you desire
2. Create a new branch in the `xmtp-android` repo
With `libxmtp` repo and `xmtp-android` (this repo) cloned locally in sibling directories, and `libxmtp` checked out to the correct release commit, run the script:
1. From repo [libxmtp](https://github.com/xmtp/libxmtp) run the [kotlin release action](https://github.com/xmtp/libxmtp/actions/workflows/release-kotlin-bindings.yml) for the branch you desire (this should take about 4 minutes)
2. Once you see the [kotlin bindings GitHub action](https://github.com/xmtp/libxmtp/actions/workflows/release-kotlin-bindings.yml) is finished, with `libxmtp` repo and `xmtp-android` (this repo) cloned locally in sibling directories, and `libxmtp` checked out to the correct release commit, run the script:
`./gen_kotlin.sh` within the `bindings_ffi` folder.
3. Run format (cmd + opt + l) function to keep the code format consistent and diff small for `xmtp-android/library/src/main/java/xmtpv3.kt`
4. Navigate to the [latest release](https://github.com/xmtp/libxmtp/releases) once the action completes
5. Download the `LibXMTPKotlinFFI.zip` assets
6. Unzip and then copy the jniLibs to `xmtp-android/library/src/main/jniLibs`
7. All instances of `value.forEach` should be changed to `value.iterator().forEach` to be compatible with API 23
8. NOTE: sometimes the library name gets updated and will cause failures the library name must be `uniffi_xmtpv3` not `xmtpv3` -- search for `findLibraryName` and make sure the correct name is returned.
3. **(If only testing, you can skip this step**)Run format (cmd + opt + l) function to keep the code format consistent and diff small for `xmtp-android/library/src/main/java/xmtpv3.kt`

You should now be on the latest libxmtp. Tests will fail if the jniLibs do not match the version of xmtpv3.

0 comments on commit 2da80a0

Please sign in to comment.