Skip to content

Commit

Permalink
fix: manifests inputs should get from corresponding task instead of `…
Browse files Browse the repository at this point in the history
…first()` selection
  • Loading branch information
2BAB committed Apr 18, 2021
1 parent eacd7b9 commit d4c4d36
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileSystemLocation

class ManifestMergeInputProvider: ApplicationSelfManageableProvider<Set<FileSystemLocation>> {
class ManifestMergeInputProvider : ApplicationSelfManageableProvider<Set<FileSystemLocation>> {

private lateinit var manifests: FileCollection

override fun initialize(project: Project,
androidExtension: AndroidComponentsExtension<*, *>,
variant: Variant) {
override fun initialize(
project: Project,
androidExtension: AndroidComponentsExtension<*, *>,
variant: Variant
) {
val t = project.tasks.withType(ProcessApplicationManifest::class.java)
manifests = t.first().getManifests()
manifests = t.filter {
it.name.contains(variant.name, true)
}.first().getManifests()
}

override fun get(defaultValue: Set<FileSystemLocation>?): Set<FileSystemLocation>? {
Expand Down

0 comments on commit d4c4d36

Please sign in to comment.