From a74e451d19c0a25be9897bef5ce565d8bce0cda1 Mon Sep 17 00:00:00 2001 From: Anton Lakotka Date: Wed, 22 Jun 2022 01:15:02 +0200 Subject: [PATCH] [Gradle] Make CInteropGist Gradle Configuration Cache friendly `sourceSets: Provider>` shouldn't be serialized to Configuration Cache. Instead, only `allSourceSetNames` should be serialized. --- .../native/internal/CInteropCommonizerTask.kt | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerTask.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerTask.kt index 36a3e9087c2..92e85b8571f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerTask.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerTask.kt @@ -35,10 +35,10 @@ internal open class CInteropCommonizerTask private val execOperations: ExecOperations, ) : AbstractCInteropCommonizerTask() { - internal data class CInteropGist( + internal class CInteropGist( @get:Input val identifier: CInteropIdentifier, @get:Input val konanTarget: KonanTarget, - @Transient @get:Internal val sourceSets: Provider>, + sourceSets: Provider>, @get:Classpath val libraryFile: Provider @@ -47,6 +47,31 @@ internal open class CInteropCommonizerTask @get:Input val allSourceSetNames: Provider> = sourceSets .map { it.withDependsOnClosure.map(Any::toString) } + + /** Autogenerated with IDEA */ + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CInteropGist + + if (identifier != other.identifier) return false + if (konanTarget != other.konanTarget) return false + if (libraryFile != other.libraryFile) return false + if (allSourceSetNames != other.allSourceSetNames) return false + + return true + } + + /** Autogenerated with IDEA */ + override fun hashCode(): Int { + var result = identifier.hashCode() + result = 31 * result + konanTarget.hashCode() + result = 31 * result + libraryFile.hashCode() + result = 31 * result + allSourceSetNames.hashCode() + return result + } + } override val outputDirectory: File = project.buildDir.resolve("classes/kotlin/commonizer")