Skip to content

Commit 11f94c3

Browse files
committed
curl
1 parent 03a811f commit 11f94c3

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

ndk/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ systemProp.org.gradle.internal.http.socketTimeout=120000
5050
android.nonTransitiveRClass=true
5151

5252
android.suppressUnsupportedCompileSdk=34
53+
54+
# TODO: clean up
55+
sentryBackend=native

ndk/lib/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(Sentry-Android LANGUAGES C CXX)
33

4+
if(POLICY CMP0079)
5+
cmake_policy(SET CMP0079 NEW)
6+
endif()
7+
48
# Add sentry-android shared library
59
add_library(sentry-android SHARED src/main/jni/sentry.c)
610

@@ -21,8 +25,10 @@ target_sources(sentry PRIVATE
2125
)
2226

2327
if(SENTRY_BACKEND STREQUAL "native")
28+
find_package(curl REQUIRED CONFIG)
29+
# TODO: SENTRY_TRANSPORT=curl
2430
target_sources(sentry-crash PRIVATE
25-
${CMAKE_CURRENT_SOURCE_DIR}/src/main/jni/sentry_android_transport.c
31+
${SENTRY_NATIVE_SRC}/src/transports/sentry_http_transport_curl.c
2632
)
2733
target_compile_definitions(sentry-android PRIVATE SENTRY_BACKEND_NATIVE)
2834
set_target_properties(sentry-crash PROPERTIES
@@ -31,6 +37,7 @@ if(SENTRY_BACKEND STREQUAL "native")
3137
SUFFIX ".so"
3238
)
3339
target_link_options(sentry-crash PRIVATE "-Wl,-z,max-page-size=16384")
40+
target_link_libraries(sentry-crash PRIVATE curl::curl_static)
3441
target_link_libraries(sentry-android PRIVATE dl)
3542
endif()
3643

ndk/lib/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ android {
5353
}
5454

5555
buildFeatures {
56+
prefab = true
5657
prefabPublishing = true
5758
buildConfig = true
5859
}
@@ -102,6 +103,9 @@ android {
102103
}
103104

104105
dependencies {
106+
// TODO: this was the first match on maven central..
107+
implementation("io.github.vvb2060.ndk:curl:8.18.0")
108+
105109
compileOnly("org.jetbrains:annotations:23.0.0")
106110

107111
testImplementation("androidx.test.ext:junit:1.3.0")

ndk/sample/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application tools:ignore="MissingApplicationIcon">
68

79
<activity

0 commit comments

Comments
 (0)