Skip to content

Commit

Permalink
Fix default language merge bugs (#561)
Browse files Browse the repository at this point in the history
- The distinct call was incorrectly excluding files it shouldn't have been
- The hasGraphicCategory call is dependent on parent folder status which used to be changed as we processed files

Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX authored May 6, 2019
1 parent 820d706 commit 8aa491d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import com.github.triplet.gradle.play.internal.nullOrFull
import com.github.triplet.gradle.play.internal.orNull
import com.github.triplet.gradle.play.internal.parents
import com.github.triplet.gradle.play.internal.playPath
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.file.CopySpec
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
Expand Down Expand Up @@ -72,7 +74,8 @@ open class GenerateResources : DefaultTask() {
}
inputs.removed { project.delete(file.findDest()) }

for (default in changedDefaults.reversed().distinctBy { it.name }) {
val writeQueue = mutableListOf<Action<CopySpec>>()
for (default in changedDefaults) {
val listings = default.findDest().climbUpTo(LISTINGS_PATH)!!
val relativePath = default.invariantSeparatorsPath.split("$defaultLocale/").last()

Expand All @@ -82,11 +85,12 @@ open class GenerateResources : DefaultTask() {
.filterNot(File::exists)
.filterNot(::hasGraphicCategory)
.forEach {
project.copy {
writeQueue += Action {
from(default).into(File(resDir, it.parentFile.toRelativeString(resDir)))
}
}
}
writeQueue.forEach { project.copy(it) }
}

private fun File.validate() {
Expand Down

0 comments on commit 8aa491d

Please sign in to comment.