Skip to content

Commit

Permalink
Fix a configuration cache issue (#6073)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Jul 23, 2024
1 parent 66a1be0 commit ba2aaf1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion build-logic/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import kotlinx.coroutines.runBlocking
import net.mbonnin.vespene.lib.NexusStagingClient
import org.gradle.api.Project
import org.gradle.api.attributes.Usage
import org.gradle.api.internal.file.FileOperations
import org.gradle.api.plugins.ExtraPropertiesExtension
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
Expand All @@ -18,6 +19,7 @@ import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Jar
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import javax.inject.Inject

fun Project.configurePublishing(isAggregateKdoc: Boolean = false) {
apply {
Expand Down Expand Up @@ -122,8 +124,15 @@ fun Project.configureDokkaAggregate() {
dependencies.add(project.dependencies.create("${coordinate.module}:${coordinate.version}:javadoc"))
}

val fileOperations = objects.newInstance(FileOperationsHolder::class.java).fileOperations

tasks.register("extractApolloKdocVersion_$versionString", Copy::class.java) {
from(configuration.elements.map { it.map { zipTree(it) } })

from(configuration.elements.map {
it.map {
fileOperations.zipTree(it)
}
})
into(layout.buildDirectory.dir("kdoc-versions/${coordinate.version}"))
}
}
Expand Down Expand Up @@ -154,6 +163,8 @@ fun Project.configureDokkaAggregate() {
}
}

private abstract class FileOperationsHolder @Inject constructor(val fileOperations: FileOperations)

private fun Project.getOssStagingUrl(): String {
val url = try {
this.extensions.extraProperties["ossStagingUrl"] as String?
Expand Down

0 comments on commit ba2aaf1

Please sign in to comment.