-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move NDK from sentry-java to sentry-native (#944)
* Added initial poc * Re-structure package names to NDK * Post PoC cleanup * setup module name for prefab * Prepare for publishing * Switch to shared STL instead of static * Wire ndk artifact generation with github actions * Fix distDir * Update Changelog * Setup Java/Gradle for CI * Update READMEs * Fix typos * Build libraries with c++_shared to comply with prefab * Address PR feedback
- Loading branch information
Showing
38 changed files
with
2,574 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,10 @@ CodeChecker | |
|
||
# Coverage | ||
coverage | ||
|
||
# Gradle / Java | ||
local.properties | ||
.gradle | ||
.cxx | ||
build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Android NDK support for sentry-native | ||
|
||
| Package | Maven Central | Minimum Android API Level | Supported ABIs | | ||
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------- | | ||
| `io.sentry:sentry-native-ndk` | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-native-ndk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-native-ndk) | 19 | "x86", "armeabi-v7a", "x86_64", "arm64-v8a" | | ||
|
||
## Resources | ||
|
||
- [SDK Documentation](https://docs.sentry.io/platforms/native/) | ||
- [Discord](https://discord.gg/ez5KZN7) server for project discussions | ||
- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates | ||
|
||
## About | ||
|
||
The sub-project aims to automatically bundle pre-built `sentry-native` binaries together with a Java JNI layer into an Android friendly `.aar` package. | ||
|
||
The `.aar` package also provides [prefab](https://developer.android.com/build/native-dependencies?buildsystem=cmake) support, giving you the possibility to consume the native `sentry.h` APIs from your native app code. | ||
|
||
If you're using the [Sentry Android SDK](https://docs.sentry.io/platforms/android/), this package is included by default already. | ||
|
||
Besides the main package in `ndk/lib`, a simple Android app for for testing purposes is provided in the `ndk/sample` folder. | ||
|
||
## Building and Installation | ||
|
||
The `ndk` project uses the Gradle build system in combination with CMake. You can either use a suitable IDE (e.g. Android Studio) or the command line to build it. | ||
|
||
## Testing and consuming a local package version | ||
|
||
1. Set a custom `versionName` in the `ndk/gradle.properties` file | ||
2. Publish the package locally | ||
|
||
```shell | ||
cd ndk | ||
./gradlew :sentry-native-ndk:publishToMavenLocal | ||
``` | ||
|
||
3. Consume the build in your app | ||
|
||
``` | ||
// usually settings.gradle | ||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} | ||
// usually app/build.gradle | ||
android { | ||
buildFeatures { | ||
prefab = true | ||
} | ||
} | ||
dependencies { | ||
implementation("io.sentry:sentry-native-ndk:<version>") | ||
} | ||
``` | ||
|
||
4. Link the pre-built packages with your native code | ||
|
||
```cmake | ||
# usually app/CMakeLists.txt | ||
find_package(sentry-native-ndk REQUIRED CONFIG) | ||
target_link_libraries(<app> PRIVATE | ||
${LOG_LIB} | ||
sentry-native-ndk::sentry-android | ||
sentry-native-ndk::sentry | ||
) | ||
``` | ||
|
||
## Development | ||
|
||
Please see the [contribution guide](../CONTRIBUTING.md). |
Oops, something went wrong.