Skip to content

Commit

Permalink
Fix Variant.localAndroidResources
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonlee committed Jul 21, 2024
1 parent 6bbcfe3 commit 3a6dca1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ fun Project.getJarTaskProviders(
is ApplicationAndroidComponentsExtension -> variants.filter().mapNotNull(Variant::bundleClassesTaskProvider)
else -> emptyList()
}

isJavaLibrary -> listOf(tasks.named(JavaPlugin.JAR_TASK_NAME))
else -> emptyList()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,14 @@ internal object V80 : AGPInterface {
override val Variant.localAndroidResources: FileCollection
get() = component.services.fileCollection().from(component.sources.res?.getLocalSources()?.values?.map {
it.map { dirs ->
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
if (dirs.isEmpty()) {
project.files()
} else {
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ internal object V81 : AGPInterface {
!it.isUserAdded && !it.isGenerated
}?.values?.map {
it.map { dirs ->
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
if (dirs.isEmpty()) {
project.files()
} else {
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ internal object V82 : AGPInterface {
!it.isUserAdded && !it.isGenerated
}?.values?.map {
it.map { dirs ->
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
if (dirs.isEmpty()) {
project.files()
} else {
dirs.map { dir ->
dir.asFileTree
}.reduce { acc, dir ->
acc.plus(dir)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.didiglobal.booster.task.graph

import com.android.build.api.variant.Variant
import com.didiglobal.booster.gradle.getTaskName
import com.didiglobal.booster.gradle.project
import com.didiglobal.booster.gradle.registerTask
import com.didiglobal.booster.graph.Edge
Expand Down

0 comments on commit 3a6dca1

Please sign in to comment.