diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49f07cf02c..0f5adc3faf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) diff --git a/build.gradle.kts b/build.gradle.kts index d958725751..67c688850f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -49,10 +49,11 @@ tasks.withType { 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) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2d9a37f823..16d2e53da0 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -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 { diff --git a/buildSrc/gradle/libs.versions.toml b/buildSrc/gradle/libs.versions.toml new file mode 120000 index 0000000000..d9b1d4e688 --- /dev/null +++ b/buildSrc/gradle/libs.versions.toml @@ -0,0 +1 @@ +../../gradle/libs.versions.toml \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts deleted file mode 100644 index 2be0c198ff..0000000000 --- a/buildSrc/settings.gradle.kts +++ /dev/null @@ -1,8 +0,0 @@ - -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - from(files("../gradle/libs.versions.toml")) - } - } -}