File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
examples/android-instrumentation-sample
plugin-build/src/main/kotlin/io/sentry/android/gradle Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ sentry {
108
108
109
109
includeSourceContext.set(true )
110
110
autoUploadSourceContext.set(CI .canAutoUpload())
111
+ autoUploadSourceContextBuildTypes.set(setOf (" debug" , " release" ))
111
112
additionalSourceDirsForSourceContext.set(setOf (" src/custom/java" ))
112
113
113
114
org.set(" sentry-sdks" )
Original file line number Diff line number Diff line change @@ -305,10 +305,9 @@ private fun Variant.configureSourceBundleTasks(
305
305
taskSuffix
306
306
)
307
307
308
- if (variant.buildTypeName == " release " ) {
308
+ if (extension.autoUploadSourceContextBuildTypes.get().contains( variant.buildTypeName) ) {
309
309
sourceContextTasks.uploadSourceBundleTask.hookWithAssembleTasks(project, variant)
310
310
}
311
-
312
311
return sourceContextTasks
313
312
} else {
314
313
project.logger.info {
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ private fun ApplicationVariant.configureSourceBundleTasks(
228
228
taskSuffix
229
229
)
230
230
231
- if (variant.buildTypeName == " release " ) {
231
+ if (extension.autoUploadSourceContextBuildTypes.get().contains( variant.buildTypeName) ) {
232
232
sourceContextTasks.uploadSourceBundleTask.hookWithAssembleTasks(project, variant)
233
233
}
234
234
Original file line number Diff line number Diff line change @@ -156,6 +156,13 @@ abstract class SentryPluginExtension @Inject constructor(project: Project) {
156
156
val autoUploadSourceContext: Property <Boolean > = objects
157
157
.property(Boolean ::class .java).convention(true )
158
158
159
+ /* *
160
+ * Which build types should be considered for automatic source context upload.
161
+ * Default is "release" only.
162
+ */
163
+ val autoUploadSourceContextBuildTypes: SetProperty <String > = objects
164
+ .setProperty(String ::class .java).convention(setOf (" release" ))
165
+
159
166
/* *
160
167
* Configure additional directories to be included in the source bundle which is used for
161
168
* source context. The directories should be specified relative to the Gradle module/project's
You can’t perform that action at this time.
0 commit comments