Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

adding nativeBundle plugin #161

Merged
merged 6 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ buildscript {
classpath(kotlin(Config.BuildPlugins.kotlinGradlePlugin, version = Config.kotlinVersion))
classpath(Config.QualityPlugins.errorpronePlugin)
classpath(Config.Deploy.novodaBintray)
classpath(Config.NativePlugins.nativeBundle)
}
}

Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@ object Config {
val override = true
val sign = true
}

object NativePlugins {
val nativeBundle = "com.ydq.android.gradle.build.tool:nativeBundle:1.0.3"
}
}
17 changes: 11 additions & 6 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ plugins {
kotlin("android")
jacoco
id(Config.Deploy.novodaBintrayId)
id("com.ydq.android.gradle.native-aar.export")
}

android {
compileSdkVersion(Config.Android.compileSdkVersion)
buildToolsVersion(Config.Android.buildToolsVersion)

val sentryNativeSrc = if (File("${project.projectDir}/sentry-native-local").exists()) {
"sentry-native-local"
} else {
"sentry-native"
}

defaultConfig {
targetSdkVersion(Config.Android.targetSdkVersion)
minSdkVersion(Config.Android.minSdkVersionNdk) // NDK requires a higher API level than core.
Expand All @@ -27,14 +34,8 @@ android {
versionCode = Config.Sentry.buildVersionCode

externalNativeBuild {
val sentryNativeSrc = if (File("${project.projectDir}/sentry-native-local").exists()) {
"sentry-native-local"
} else {
"sentry-native"
}
cmake {
arguments.add(0, "-DANDROID_STL=c++_static")
arguments.add(0, "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
arguments.add(0, "-DSENTRY_NATIVE_SRC=$sentryNativeSrc")
}
}
Expand Down Expand Up @@ -102,6 +103,10 @@ android {
}

ndkVersion = "20.1.5948944"

nativeBundleExport {
headerDir = "${project.projectDir}/$sentryNativeSrc/include"
}
}

dependencies {
Expand Down
10 changes: 0 additions & 10 deletions sentry-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ android {
externalNativeBuild {
cmake {
arguments.add(0, "-DANDROID_STL=c++_static")
arguments.add(0, "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
}
}

Expand Down Expand Up @@ -72,15 +71,6 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

// if travis ci hangs again on this task, remove comments
// tasks.all {
// if (this.name == "signingConfigWriterDebugAndroidTest") {
// this.enabled = false
// println("${this.name} is SKIPPED")
// }
// }

}

dependencies {
Expand Down