-
-
Notifications
You must be signed in to change notification settings - Fork 427
/
build.gradle.kts
135 lines (114 loc) · 4.04 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
plugins {
id("com.android.application")
kotlin("android")
}
android {
compileSdk = Config.Android.compileSdkVersion
defaultConfig {
applicationId = "io.sentry.samples.android"
minSdk = Config.Android.minSdkVersionCompose
targetSdk = 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
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Config.composeVersion
}
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"
)
)
}
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
variantFilter {
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
ignore = true
}
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
implementation(projects.sentryAndroid)
implementation(projects.sentryAndroidOkhttp)
implementation(projects.sentryAndroidFragment)
implementation(projects.sentryAndroidTimber)
implementation(projects.sentryCompose)
implementation(Config.Libs.fragment)
implementation(Config.Libs.timber)
// how to exclude androidx if release health feature is disabled
// implementation(projects.sentryAndroid) {
// exclude(group = "androidx.lifecycle", module = "lifecycle-process")
// exclude(group = "androidx.lifecycle", module = "lifecycle-common-java8")
// exclude(group = "androidx.core", module = "core")
// }
implementation(Config.Libs.appCompat)
implementation(Config.Libs.androidxRecylerView)
implementation(Config.Libs.retrofit2)
implementation(Config.Libs.retrofit2Gson)
implementation(Config.Libs.composeActivity)
implementation(Config.Libs.composeFoundation)
implementation(Config.Libs.composeFoundationLayout)
implementation(Config.Libs.composeNavigation)
implementation(Config.Libs.composeMaterial)
debugImplementation(Config.Libs.leakCanary)
}