Skip to content

Commit 51860e1

Browse files
committed
swapping dependencyUpdates for caupain
1 parent cf60da2 commit 51860e1

9 files changed

Lines changed: 59 additions & 178 deletions

File tree

.github/workflows/check-dependency-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
run: ./gradlew checkDependencyUpdates --no-configuration-cache --stacktrace
3535

3636
- name: Update summary
37-
run: cat build/reports/dependencies-update.md >> $GITHUB_STEP_SUMMARY
37+
run: cat ./build/reports/dependency-updates.md >> $GITHUB_STEP_SUMMARY

RELEASE_CHECK_LIST.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- For major releases: update a project version in the file [`v.list`](https://github.com/Kotlin/dataframe/blame/master/docs/StardustDocs/v.list)
1515
- For major releases: update a project version in the file [`main.yml`](https://github.com/Kotlin/dataframe/blob/master/.github/workflows/main.yml)
1616
- For major releases: update a project version in the file [`project.ihp`](https://github.com/Kotlin/dataframe/blob/master/docs/StardustDocs/project.ihp)
17-
7. Update `libs.versions.toml` file if required, run `./gradlew dependencyUpdates` to check for updates. **RC**
17+
7. Update `libs.versions.toml` file if required, run `./gradlew checkDependencyUpdates` to check for updates. **RC**
1818
8. Create and checkout the release branch. **RC**
1919
9. Make last commit with release tag (_v0.1.1_ for example) to the release branch. **RC**
2020
10. Run tests and build artifacts on TC for the commit with the release tag. **RC**

build-logic/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ acting as [Convention Plugins](https://docs.gradle.org/current/userguide/impleme
4141
- NOTE: Only apply this plugin to the root project!
4242
- NOTE: Add every dependency version that needs to be synced to the `libs.versions.toml` file of the example in
4343
the `versionsToSync` list!
44-
- NOTE: Add every dependency used in each example project to `dependencies { exampleDependencyUpdates() }`
45-
so `dependencyUpdates` can detect outdated dependencies in examples.
4644

4745
- Projects inside `/examples/projects` are built using the latest release version of DataFrame.
4846
They are meant to be downloadable as separate projects by users.
@@ -79,3 +77,14 @@ acting as [Convention Plugins](https://docs.gradle.org/current/userguide/impleme
7977
code in Notebooks or any of our [plugins](../plugins). Words like "package", "fun", "suspend", etc...
8078
As the Kotlin language can change over time, this task ensures that any changes to the language
8179
will be reflected in our code generation.
80+
81+
- `dfbuild.caupain`: Allows tracking updates for dependencies in `/gradle/libs.versions.toml`.
82+
This plugin is meant to be applied only to the main project.
83+
- See https://github.com/deezer/caupain/tree/main for more information.
84+
- Run `checkDependencyUpdates` to check for outdated dependencies.
85+
This produces a report in the terminal, and as HTML and Markdown files in `/build/reports`.
86+
- There's also `replaceOutdatedDependencies` to replace outdated dependencies directly in the
87+
`/gradle/libs.versions.toml` file, but be careful.
88+
- Comment `#ignoreUpdates` in `/gradle/libs.versions.toml` to ignore updates for specific dependencies.
89+
- `/.github/workflows/check-dependency-updates.yml` is a Github Action which runs `checkDependencyUpdates`.
90+

build-logic/src/main/kotlin/dfbuild.buildExampleProjects.gradle.kts

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import dfbuild.buildExampleProjects.isAndroid
55
import dfbuild.buildExampleProjects.setupGradleSyncVersionsTask
66
import dfbuild.buildExampleProjects.setupMavenSyncVersionsTask
77
import dfbuild.getVersionName
8-
import org.gradle.api.provider.Provider
98
import org.gradle.internal.extensions.stdlib.capitalized
10-
import org.gradle.plugin.use.PluginDependency
119
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
1210
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1311
import org.jetbrains.kotlinx.dataframe.impl.toCamelCaseByDelimiters
@@ -58,96 +56,6 @@ val versionsToSync =
5856
)
5957
}.map { it.getVersionName() }
6058

61-
val exampleDependencyUpdates by configurations.creating {
62-
isCanBeResolved = true
63-
isCanBeConsumed = false
64-
isVisible = false
65-
}
66-
67-
/**
68-
* Every library and plugin used by the projects in /examples/projects (excluding deps already
69-
* declared by the root build itself, which `dependencyUpdates` picks up anyway).
70-
*
71-
* This makes the ben-manes `dependencyUpdates` task aware of example-only dependencies without
72-
* having to apply the plugin inside the example projects.
73-
*/
74-
dependencies {
75-
// android-example
76-
exampleDependencyUpdates(libs.androidx.core.ktx)
77-
exampleDependencyUpdates(libs.androidx.junit)
78-
exampleDependencyUpdates(libs.androidx.espresso.core)
79-
exampleDependencyUpdates(libs.androidx.lifecycle.runtime.ktx)
80-
exampleDependencyUpdates(libs.androidx.activity.compose)
81-
// BOM-managed compose artifacts (versions come from the BOM)
82-
exampleDependencyUpdates(platform(libs.androidx.compose.bom))
83-
exampleDependencyUpdates(libs.androidx.ui)
84-
exampleDependencyUpdates(libs.androidx.ui.graphics)
85-
exampleDependencyUpdates(libs.androidx.ui.tooling)
86-
exampleDependencyUpdates(libs.androidx.ui.tooling.preview)
87-
exampleDependencyUpdates(libs.androidx.ui.test.manifest)
88-
exampleDependencyUpdates(libs.androidx.ui.test.junit4)
89-
exampleDependencyUpdates(libs.androidx.material3)
90-
exampleDependencyUpdates(pluginMarker(libs.plugins.android.application))
91-
exampleDependencyUpdates(pluginMarker(libs.plugins.kotlin.android))
92-
exampleDependencyUpdates(pluginMarker(libs.plugins.kotlin.compose))
93-
94-
// exposed
95-
exampleDependencyUpdates(libs.sqlite)
96-
exampleDependencyUpdates(libs.exposed.core)
97-
exampleDependencyUpdates(libs.exposed.kotlin.datetime)
98-
exampleDependencyUpdates(libs.exposed.jdbc)
99-
exampleDependencyUpdates(libs.exposed.json)
100-
exampleDependencyUpdates(libs.exposed.money)
101-
102-
// hibernate
103-
exampleDependencyUpdates(libs.hibernate.core)
104-
exampleDependencyUpdates(libs.hibernate.hikaricp)
105-
exampleDependencyUpdates(libs.hikaricp)
106-
exampleDependencyUpdates(libs.h2db)
107-
exampleDependencyUpdates(libs.sl4jsimple)
108-
109-
// json-openapi
110-
exampleDependencyUpdates(libs.dataframe.openapi)
111-
exampleDependencyUpdates(libs.dataframe.openapi.generator)
112-
113-
// kotlin-dataframe-plugin-gradle-example
114-
exampleDependencyUpdates(libs.dataframe)
115-
exampleDependencyUpdates(libs.kandy)
116-
117-
// kotlin-dataframe-plugin-maven-example
118-
exampleDependencyUpdates(libs.maven.exec.plugin)
119-
exampleDependencyUpdates(libs.maven.surefire.plugin)
120-
121-
// kotlin-spark
122-
exampleDependencyUpdates(libs.spark3.sql)
123-
exampleDependencyUpdates(libs.kotlin.spark)
124-
exampleDependencyUpdates(libs.log4j.core)
125-
exampleDependencyUpdates(libs.log4j.api)
126-
127-
// movies
128-
// all already here
129-
130-
// multik
131-
exampleDependencyUpdates(libs.multik.core)
132-
exampleDependencyUpdates(libs.multik.default)
133-
134-
// spark-parquet-dataframe
135-
exampleDependencyUpdates(libs.spark4.sql)
136-
exampleDependencyUpdates(libs.spark4.mllib)
137-
138-
// titanic
139-
exampleDependencyUpdates(libs.kotlin.dl.api)
140-
exampleDependencyUpdates(libs.kotlin.dl.impl)
141-
exampleDependencyUpdates(libs.kotlin.dl.tensorflow)
142-
exampleDependencyUpdates(libs.kotlin.dl.dataset)
143-
144-
// youtube
145-
exampleDependencyUpdates(libs.kotlin.datetimeJvm)
146-
}
147-
148-
private fun pluginMarker(provider: Provider<PluginDependency>): Provider<String> =
149-
provider.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}" }
150-
15159
val syncAllExampleFolders by tasks.registering {
15260
group = buildExampleProjectsGroup
15361
description = "Sync the versions in the nested projects in /examples/projects"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import com.deezer.caupain.plugin.DependenciesUpdateTask
2+
import com.deezer.caupain.policies.StabilityLevelPolicy
3+
4+
plugins {
5+
alias(conventions.plugins.dfbuild.base)
6+
7+
alias(libs.plugins.caupain)
8+
}
9+
10+
caupain {
11+
showVersionReferences = true
12+
repositories {
13+
libraries = libraries.get()
14+
.filterNot { it.url == "https://redirector.kotlinlang.org/maven/bootstrap" }
15+
}
16+
outputs {
17+
markdown { enabled = true }
18+
}
19+
System.getenv("CAUPAIN_GITHUB_TOKEN")?.let {
20+
githubToken = it
21+
searchReleaseNote = true
22+
}
23+
}
24+
25+
tasks.withType<DependenciesUpdateTask> {
26+
selectIf {
27+
StabilityLevelPolicy.select(dependency, currentVersion, updatedVersion) &&
28+
!updatedVersion.text.matches("^.*-preview([0-9]+)?$".toRegex())
29+
}
30+
}

build-logic/src/main/kotlin/dfbuild.dependencyUpdates.gradle.kts

Lines changed: 0 additions & 77 deletions
This file was deleted.

build-settings-logic/src/main/kotlin/dfsettings.base.settings.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ pluginManagement {
2626
gradlePluginPortal()
2727
mavenCentral()
2828
maven("https://redirector.kotlinlang.org/maven/bootstrap")
29+
google {
30+
content {
31+
includeGroupByRegex("com\\.android.*")
32+
includeGroupByRegex("com\\.google.*")
33+
includeGroupByRegex("androidx.*")
34+
}
35+
}
2936
}
3037
}
3138

build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ plugins {
66
with(conventions.plugins.dfbuild) {
77
alias(kotlinJvm8)
88
alias(buildExampleProjects)
9-
alias(dependencyUpdates)
9+
alias(caupain)
1010
}
11-
1211
with(libs.plugins) {
1312
alias(publisher)
1413
alias(serialization) apply false

gradle/libs.versions.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,25 @@ kotlinLogging = "8.0.4"
4545
sl4j = "2.0.18"
4646
log4j = "2.26.1"
4747

48+
# ignoreUpdates
4849
junit = "4.13.2" # Issue #426
50+
# ignoreUpdates
4951
junit-jupiter = "5.11.3"
52+
# ignoreUpdates
5053
junit-platform = "1.11.3" # Issue #426
5154
kotestAsserions = "6.2.2"
5255

5356
jsoup = "1.22.2"
5457
arrow = "19.0.0"
5558
kodex = "0.5.4"
5659
simpleGit = "2.3.1"
57-
dependencyVersions = "0.54.0"
60+
caupain = "1.9.1"
5861
plugin-publish = "2.1.1"
5962
shadow = "9.5.1"
63+
# ignoreUpdates
6064
android-gradle-api = "7.3.1" # unused for now
6165
ktor = "3.5.1"
66+
# ignoreUpdates
6267
kotlin-compile-testing = "0.7.1" # unused for now
6368
hikari = "7.1.0"
6469
duckdb = "1.5.4.0"
@@ -77,7 +82,7 @@ hibernate = "7.4.4.Final"
7782

7883
# check the versions down in the [libraries] section too!
7984
kotlin-spark = "1.2.4"
80-
spark3 = "3.3.2"
85+
spark3 = "3.3.2" # ignoreUpdates
8186
spark4 = "4.1.2"
8287

8388
multik = "0.3.1"
@@ -263,7 +268,7 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
263268
kodex = { id = "nl.jolanrensen.kodex", version.ref = "kodex" }
264269
simpleGit = { id = "xyz.ronella.simple-git", version.ref = "simpleGit" }
265270
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
266-
dependencyVersions = { id = "com.github.ben-manes.versions", version.ref = "dependencyVersions" }
271+
caupain = { id = "com.deezer.caupain", version.ref = "caupain" }
267272
plugin-publish = { id = "com.gradle.plugin-publish", version.ref = "plugin-publish" }
268273
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
269274
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }

0 commit comments

Comments
 (0)