File tree Expand file tree Collapse file tree
sentry-android-gradle-plugin/src/main/groovy/io/sentry/android/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,16 +153,18 @@ class SentryPlugin implements Plugin<Project> {
153153 manifestPath = variantOutput. processManifest. manifestOutputFile
154154 } catch (Exception ignored) {
155155 // Android Gradle Plugin >= 3.0.0
156- manifestPath = new File (
157- variantOutput. processManifest. manifestOutputDirectory. toString(),
158- " AndroidManifest.xml" )
159- if (! manifestPath. isFile()) {
160- manifestPath = new File (
161- new File (
162- variantOutput. processManifest. manifestOutputDirectory. toString(),
163- variantOutput. dirName),
164- " AndroidManifest.xml" )
156+ def outputDir = variantOutput. processManifest. manifestOutputDirectory
157+ // Gradle 4.7 introduced the lazy task API and AGP 3.3+ adopts that,
158+ // so we apparently have a Provider<File> here instead
159+ // TODO: This will let us depend on the configuration of each flavor's
160+ // manifest creation task and their transitive dependencies, which in
161+ // turn prolongs the configuration time accordingly. Evaluate how Gradle's
162+ // new Task Avoidance API can be used instead.
163+ // (https://docs.gradle.org/current/userguide/task_configuration_avoidance.html)
164+ if (! (outputDir instanceof File )) {
165+ outputDir = outputDir. get(). asFile
165166 }
167+ manifestPath = new File (outputDir, " AndroidManifest.xml" )
166168 }
167169 }
168170
You can’t perform that action at this time.
0 commit comments