Skip to content

Commit e41ced3

Browse files
chibatchingbruno-garcia
authored andcommitted
Add task dependency to adapt App Bundle (#707)
1 parent 8969506 commit e41ced3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sentry-android-gradle-plugin/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ class SentryPlugin implements Plugin<Project> {
138138
return project.tasks.findByName("dex${names[0]}")
139139
}
140140

141+
/**
142+
* Returns the bundle task for the given project and variant.
143+
*
144+
* @param project
145+
* @param variant
146+
* @return
147+
*/
148+
static Task getBundleTask(Project project, ApplicationVariant variant) {
149+
return project.tasks.findByName("build${variant.name.capitalize()}PreBundle")
150+
}
151+
141152
/**
142153
* Returns the path to the debug meta properties file for the given variant.
143154
*
@@ -174,6 +185,7 @@ class SentryPlugin implements Plugin<Project> {
174185
def mappingFile = variant.getMappingFile()
175186
def proguardTask = getProguardTask(project, variant)
176187
def dexTask = getDexTask(project, variant)
188+
def bundleTask = getBundleTask(project, variant)
177189

178190
if (proguardTask == null) {
179191
return
@@ -282,6 +294,10 @@ class SentryPlugin implements Plugin<Project> {
282294
} else {
283295
proguardTask.finalizedBy(persistIdsTask)
284296
}
297+
// To include proguard uuid file into aab, run before bundle task.
298+
if (bundleTask != null) {
299+
bundleTask.dependsOn persistIdsTask
300+
}
285301
persistIdsTask.dependsOn proguardTask
286302
}
287303
}

0 commit comments

Comments
 (0)