Skip to content

Commit

Permalink
Hack around ben-manes/gradle-versions-plugin#284 by symlinking the ve…
Browse files Browse the repository at this point in the history
…rsion catalog into buildSrc
  • Loading branch information
PawelLipski committed Aug 1, 2022
1 parent a6be92e commit 05a4775
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ docker run --rm -e UID=$(id -u) -e GID=$(id -g) \
## Update version catalog

```shell
./gradlew versionCatalogUpdate
# TODO (#1011): `|| true` should not be needed
(./gradlew versionCatalogUpdate || true; cd buildSrc; ../gradlew versionCatalogUpdate || true)
```

See [version catalog in Gradle docs](https://docs.gradle.org/current/userguide/platforms.html)
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ tasks.withType<DependencyUpdatesTask> {
rejectVersionIf { !isStableVersion(this.candidate.version) }
}

// TODO (#1010): make it possible to bump dependencies of buildSrc as well (and not only of the project itself)
versionCatalogUpdate {
sortByKey.set(false)

// TODO (ben-manes/gradle-versions-plugin#284): `versionCatalogUpdate` should work on both the project and project's buildSrc
// The `keep` settings are needed so that a `versionCatalogUpdate` on the project doesn't remove the dependencies of buildSrc
keep {
keepUnusedVersions.set(true)
keepUnusedLibraries.set(true)
Expand Down
14 changes: 14 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
alias(libs.plugins.jetbrains.kotlin)
alias(libs.plugins.versions)
alias(libs.plugins.versionCatalogUpdate)
}

versionCatalogUpdate {
sortByKey.set(false)

// TODO (ben-manes/gradle-versions-plugin#284): `versionCatalogUpdate` should work on both the project and project's buildSrc
// The `keep` settings are needed so that a `versionCatalogUpdate` on buildSrc doesn't remove the dependencies of the project
keep {
keepUnusedVersions.set(true)
keepUnusedLibraries.set(true)
keepUnusedPlugins.set(true)
}
}

repositories {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/gradle/libs.versions.toml
8 changes: 0 additions & 8 deletions buildSrc/settings.gradle.kts

This file was deleted.

0 comments on commit 05a4775

Please sign in to comment.