Skip to content

Commit

Permalink
Merge pull request #136 from littlerobots/feature/multiple-version-se…
Browse files Browse the repository at this point in the history
…lectors

Add version selector override for each TOML file
  • Loading branch information
hvisser committed Dec 24, 2023
2 parents af27a5e + 7c2080f commit d653b9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -87,6 +87,13 @@ abstract class VersionCatalogConfig @Inject constructor(val name: String) {

@get:Nested
abstract val keep: KeepConfiguration

@get:Optional
internal abstract var versionSelector: ModuleVersionSelector?

fun versionSelector(selector: ModuleVersionSelector) {
this.versionSelector = selector
}
}

abstract class PinConfiguration : VersionRefConfiguration()
Expand Down
Expand Up @@ -147,7 +147,7 @@ class VersionCatalogUpdatePlugin : Plugin<Project> {
task.catalogFile.set(versionCatalogConfig.catalogFile.asFile)
task.notCompatibleWithConfigurationCache("Uses project")
task.outputs.upToDateWhen { false }
val versionSelector = extension.versionSelector ?: VersionSelectors.DEFAULT
val versionSelector = versionCatalogConfig.versionSelector ?: extension.versionSelector ?: VersionSelectors.DEFAULT
task.versionSelector(versionSelector)
}
}
Expand Down

0 comments on commit d653b9a

Please sign in to comment.