From 7b0b0e6fdacceced1a6c3a42eecaed14179c96fb Mon Sep 17 00:00:00 2001 From: Joaquim Alvino de Mesquita Neto Date: Thu, 24 Aug 2023 16:11:54 +0200 Subject: [PATCH] works around gradle 7 bug in collectOutputs task (#15) works around gradle 7 bug in collectOutputs tasl --- .../wooga/gradle/build/unity/ios/IOSBuildPlugin.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/groovy/wooga/gradle/build/unity/ios/IOSBuildPlugin.groovy b/src/main/groovy/wooga/gradle/build/unity/ios/IOSBuildPlugin.groovy index 40d4451..f4e341f 100644 --- a/src/main/groovy/wooga/gradle/build/unity/ios/IOSBuildPlugin.groovy +++ b/src/main/groovy/wooga/gradle/build/unity/ios/IOSBuildPlugin.groovy @@ -23,6 +23,7 @@ import org.gradle.api.Action import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task +import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.logging.Logger import org.gradle.api.logging.Logging import org.gradle.api.plugins.BasePlugin @@ -367,6 +368,10 @@ class IOSBuildPlugin implements Plugin { lockKeychain.configure({ it.mustRunAfter([xcodeArchive, xcodeExport]) }) def collectOutputs = tasks.register("collectOutputs", Sync) { + // This is needed due to a bug on gradle 7 that sometimes does not recognize the default build strategy. Exclude is the default one. + // It happens when the same file is inserted in the copy command multiple times. + // See: https://github.com/gradle/gradle/issues/17236 + it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE it.from(xcodeExport, archiveDSYM) into(project.file("${project.buildDir}/outputs")) }