Skip to content

Commit

Permalink
Merge pull request #156 from austinarbor/fix-rc
Browse files Browse the repository at this point in the history
Gradle 8.11 Fix
  • Loading branch information
austinarbor authored Oct 21, 2024
2 parents d84b393 + 428cb0a commit 42dbc42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.aga.gradle.versioncatalogs.service

import dev.aga.gradle.versioncatalogs.exception.ResolutionException
import java.io.File
import java.util.concurrent.atomic.AtomicInteger
import java.util.function.Supplier
import org.apache.maven.model.Dependency
import org.gradle.api.artifacts.Configuration
Expand Down Expand Up @@ -44,13 +43,7 @@ class PublishedArtifactResolver(
}

private fun createConfiguration(): Configuration {
val config =
drs.configurationContainer.create(
"incomingConfiguration${configurationCount.incrementAndGet()}",
)

return config.apply {
resolutionStrategy.activateDependencyLocking()
return drs.configurationContainer.detachedConfiguration().apply {
attributes {
attribute(
Category.CATEGORY_ATTRIBUTE,
Expand All @@ -61,8 +54,4 @@ class PublishedArtifactResolver(
isCanBeConsumed = false
}
}

companion object {
private val configurationCount = AtomicInteger(0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MockGradleDependencyResolver(val rootDir: Path) : DependencyResolver {
}

private val configurationContainer =
mock<ConfigurationContainer> { on { create(any<String>()) } doReturn configuration }
mock<ConfigurationContainer> { on { detachedConfiguration() } doReturn configuration }

private val drs =
mock<DependencyResolutionServices> {
Expand Down

0 comments on commit 42dbc42

Please sign in to comment.