-
-
Notifications
You must be signed in to change notification settings - Fork 427
/
build.gradle.kts
112 lines (93 loc) · 3.3 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
plugins {
id("com.android.application")
kotlin("android")
}
android {
compileSdkVersion(Config.Android.compileSdkVersion)
defaultConfig {
applicationId = "io.sentry.samples.android"
minSdkVersion(Config.Android.minSdkVersionOkHttp)
targetSdkVersion(Config.Android.targetSdkVersion)
versionCode = 2
versionName = "1.1.0"
externalNativeBuild {
val sentryNativeSrc = if (File("${project.projectDir}/../../sentry-android-ndk/sentry-native-local").exists()) {
"sentry-native-local"
} else {
"sentry-native"
}
println("sentry-samples-android: $sentryNativeSrc")
cmake {
arguments.add(0, "-DANDROID_STL=c++_static")
arguments.add(0, "-DSENTRY_NATIVE_SRC=$sentryNativeSrc")
}
}
ndk {
abiFilters.addAll(Config.Android.abiFilters)
}
}
buildFeatures {
// Determines whether to support View Binding.
// Note that the viewBinding.enabled property is now deprecated.
viewBinding = true
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
externalNativeBuild {
cmake {
path("CMakeLists.txt")
}
}
signingConfigs {
getByName("debug") {
storeFile = rootProject.file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
buildTypes {
getByName("debug") {
addManifestPlaceholders(mapOf(
"sentryDebug" to true,
"sentryEnvironment" to "debug"
))
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug") // to be able to run release mode
isShrinkResources = true
addManifestPlaceholders(mapOf(
"sentryDebug" to false,
"sentryEnvironment" to "release"
))
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
implementation(project(":sentry-android"))
implementation(project(":sentry-android-okhttp"))
// how to exclude androidx if release health feature is disabled
// implementation(project(":sentry-android")) {
// exclude(group = "androidx.lifecycle", module = "lifecycle-process")
// exclude(group = "androidx.lifecycle", module = "lifecycle-common-java8")
// }
implementation(Config.Libs.appCompat)
implementation(Config.Libs.retrofit2)
implementation(Config.Libs.retrofit2Gson)
debugImplementation(Config.Libs.leakCanary)
}