-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
158 lines (135 loc) · 4.71 KB
/
build.gradle.kts
File metadata and controls
158 lines (135 loc) · 4.71 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
plugins {
id("com.android.application")
kotlin("android")
}
android {
compileSdk = Config.Android.compileSdkVersion
namespace = "io.sentry.samples.android"
defaultConfig {
applicationId = "io.sentry.samples.android"
minSdk = Config.Android.minSdkVersion
targetSdk = Config.Android.targetSdkVersion
versionCode = 2
versionName = project.version.toString()
externalNativeBuild {
cmake {
// Android 15: As we're using an older version of AGP / NDK, the STL is not 16kb page aligned yet
// Our example code doesn't use the STL, so we simply disable it
// See https://developer.android.com/guide/practices/page-sizes
arguments.add(0, "-DANDROID_STL=none")
}
}
ndk {
abiFilters.addAll(Config.Android.abiFilters)
}
}
lint {
disable.addAll(
listOf(
"Typos",
"PluralsCandidate",
"MonochromeLauncherIcon",
"TextFields",
"ContentDescription",
"LabelFor",
"HardcodedText"
)
)
}
buildFeatures {
// Determines whether to support View Binding.
// Note that the viewBinding.enabled property is now deprecated.
viewBinding = true
compose = true
buildConfig = true
prefab = true
}
composeOptions {
kotlinCompilerExtensionVersion = Config.androidComposeCompilerVersion
}
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()
}
androidComponents.beforeVariants {
it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType)
}
@Suppress("UnstableApiUsage")
packagingOptions {
jniLibs {
useLegacyPackaging = 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.sentryAndroidFragment)
implementation(projects.sentryAndroidTimber)
implementation(projects.sentryCompose)
implementation(projects.sentryComposeHelper)
implementation(projects.sentryOkhttp)
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)
implementation(Config.Libs.composeCoil)
implementation(Config.Libs.sentryNativeNdk)
implementation(projects.sentryKotlinExtensions)
implementation(Config.Libs.coroutinesAndroid)
debugImplementation(Config.Libs.leakCanary)
}