Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change log for refreshVersions

## Version 0.60.6 (2025-08-15)

### Bug fix

Replaced usage of internal Gradle API that was removed/hidden in Gradle 9.0.0 and caused the builds of "consumer" projects to fail on Gradle upgrade.

Thanks to [AlexanderBartash](https://github.com/AlexanderBartash) for [their contribution](https://github.com/Splitties/refreshVersions/pull/736), and to the people that pinged me in issue [#735](https://github.com/Splitties/refreshVersions/issues/735)!

## Version 0.60.5 (2024-02-05)

### New dependency notation
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// settings.gradle(.kts)
plugins {
// See https://splitties.github.io/refreshVersions
id("de.fayard.refreshVersions") version "0.60.5"
id("de.fayard.refreshVersions") version "0.60.6"
}

refreshVersions { // Optional: configure the plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ extra:
slack: https://app.slack.com/client/T09229ZC6/CP5659EL9
version:
gradle: 8.5
refreshVersions: '0.60.5'
snapshot: '0.60.6-SNAPSHOT'
refreshVersions: '0.60.6'
snapshot: '0.60.7-SNAPSHOT'
keyboard_shortcuts:
find_actions: <kbd>ctrl</kbd>/<kbd>cmd</kbd> + <kbd>shift</kbd> + <kbd>A</kbd>

Expand Down
8 changes: 6 additions & 2 deletions plugins/convention-plugins/src/main/kotlin/PropertyOrEnv.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ internal fun Project.propertyOrEnv(key: String): String {
?: error("Didn't find any value for the key \"$key\" in Project properties or environment variables.")
}

internal fun Project.propertyOrEnvOrNull(key: String): String? {
return findProperty(key) as String? ?: System.getenv(key)
internal fun Project.propertyOrEnvOrNull(
key: String,
nullIfEmpty: Boolean = true
): String? {
return (findProperty(key) as String?)?.takeUnless { nullIfEmpty && it.isEmpty() }
?: System.getenv(key)?.takeUnless { nullIfEmpty && it.isEmpty() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
}

signing {
isRequired = false
useInMemoryPgpKeys(
propertyOrEnvOrNull("GPG_key_id"),
propertyOrEnvOrNull("GPG_private_key") ?: return@signing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ internal fun findMissingEntries(
.filter {
it.hasHardcodedVersion(versionsMap, versionKeyReader) && it.version != null
}
.mapNotNull { dependency: ExternalDependency ->
.map { dependency: ExternalDependency ->
val versionKey = getVersionPropertyName(
ModuleId.Maven(
group = dependency.group ?: return@mapNotNull null,
group = dependency.group,
name = dependency.name
),
versionKeyReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import de.fayard.refreshVersions.core.internal.setupVersionPlaceholdersResolving
import org.gradle.api.artifacts.ExternalDependency
import org.gradle.api.file.RegularFile
import org.gradle.api.initialization.Settings
import org.gradle.api.internal.artifacts.dependencies.DefaultClientModule
import org.gradle.kotlin.dsl.apply
import org.gradle.tooling.UnsupportedVersionException
import org.gradle.util.GradleVersion
Expand Down Expand Up @@ -212,7 +211,7 @@ private fun setupPluginsVersionsResolution(
val pluginVersion = requested.version ?: return@eachPlugin
UsedPluginsTracker.pluginHasNoEntryInVersionsFile(
settings = settings,
dependency = pluginIdToDependency(pluginId, pluginVersion)
dependency = pluginIdToDependency(settings, pluginId, pluginVersion)
)
return@eachPlugin
}
Expand Down Expand Up @@ -248,5 +247,11 @@ internal fun pluginDependencyNotationToVersionKey(dependencyNotation: String): S
else -> null
}

internal fun pluginIdToDependency(pluginId: String, version: String): ExternalDependency =
DefaultClientModule(pluginId, "$pluginId.gradle.plugin", version)
internal fun pluginIdToDependency(
settings: Settings,
pluginId: String,
version: String
): ExternalDependency {
val dependencyNotation = "$pluginId:$pluginId.gradle.plugin:$version"
return settings.gradle.rootProject.buildscript.dependencies.create(dependencyNotation) as ExternalDependency
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
0.60.3->19
0.60.4->19
0.60.5->19
0.60.6->19
2 changes: 1 addition & 1 deletion plugins/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion plugins/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.60.5
0.60.6
2 changes: 1 addition & 1 deletion sample-groovy/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion sample-groovy/versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.60.4-SNAPSHOT
#### Generated by `./gradlew refreshVersions` version 0.60.6-SNAPSHOT
#### Revision of dependency notations removals: 19
####
#### Don't manually edit or split the comments that start with four hashtags (####),
Expand Down
2 changes: 1 addition & 1 deletion sample-kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 1 addition & 5 deletions sample-kotlin/sample-kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {

group = "de.fayard"

val testGcs = providers.gradleProperty("refreshVersions.testGcs").forUseAtConfigurationTime().orNull == "true"
val testGcs = providers.gradleProperty("refreshVersions.testGcs").orNull == "true"

repositories {
mavenLocal()
Expand Down Expand Up @@ -72,10 +72,6 @@ tasks.register<JavaExec>("run") {
mainClass.set("de.fayard.GuavaTest")
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
}

tasks.withType<JavaExec>().configureEach {
classpath = sourceSets["main"].runtimeClasspath
}
Expand Down
56 changes: 17 additions & 39 deletions sample-kotlin/versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.60.4-SNAPSHOT
#### Generated by `./gradlew refreshVersions` version 0.60.6-SNAPSHOT
#### Revision of dependency notations removals: 19
####
#### Don't manually edit or split the comments that start with four hashtags (####),
Expand All @@ -10,14 +10,7 @@
####
#### NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.

plugin.org.jetbrains.kotlinx.benchmark=0.4.2
## # available=0.4.3
## # available=0.4.4
## # available=0.4.5
## # available=0.4.6
## # available=0.4.7
## # available=0.4.8
## # available=0.4.9
plugin.org.jetbrains.kotlinx.benchmark=0.4.14

## unused
plugin.com.example.unused=42
Expand Down Expand Up @@ -62,6 +55,11 @@ version.androidx.core=1.3.1
## # available=1.10.0
## # available=1.10.1
## # available=1.12.0
## # available=1.13.0
## # available=1.13.1
## # available=1.15.0
## # available=1.16.0
## # available=1.17.0

version.apache.poi=4.0.0
## # available=4.0.1
Expand All @@ -75,6 +73,10 @@ version.apache.poi=4.0.0
## # available=5.2.2
## # available=5.2.3
## # available=5.2.4
## # available=5.2.5
## # available=5.3.0
## # available=5.4.0
## # available=5.4.1

version.kotest=5.1.0
## # available=5.2.0
Expand All @@ -100,37 +102,13 @@ version.kotest=5.1.0
## # available=5.7.1
## # available=5.7.2
## # available=5.8.0
## # available=5.8.1
## # available=5.9.0
## # available=5.9.1

version.kotlin=1.6.10
## # available=1.6.20
## # available=1.6.21
## # available=1.7.0
## # available=1.7.10
## # available=1.7.20
## # available=1.7.21
## # available=1.7.22
## # available=1.8.0
## # available=1.8.0-343
## # available=1.8.10
## # available=1.8.20
## # available=1.8.21
## # available=1.8.22
## # available=1.9.0
## # available=1.9.10
## # available=1.9.20

version.kotlinx.coroutines=1.6.0
## # available=1.6.0-native-mt
## # available=1.6.1
## # available=1.6.1-native-mt
## # available=1.6.2
## # available=1.6.3
## # available=1.6.3-native-mt
## # available=1.6.4
## # available=1.7.0
## # available=1.7.1
## # available=1.7.2
## # available=1.7.3
version.kotlin=2.2.10

version.kotlinx.coroutines=1.10.2

## unused
version.org.apache.poi..poi=4.1.2
Expand Down
Loading