Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rejectVersionsIf vs. rejectVersionIf #689

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix rejectVersionsIf vs. rejectVersionIf
  • Loading branch information
Vampire committed Jul 5, 2023
commit 887812146b1eaf8171d09e2464d375835c542407
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ Look for [issues with the `Dependency notations` and `up-for-grabs` tags](https:
### New features

- refreshVersions will now add `## unused` comments on top of unused entries in the `versions.properties` file after you run the `refreshVersions` task, so you know which ones are obsolete and can be removed.
- The new `rejectVersionsIf { … }` predicate available in the `refreshVersions { … }` extension in your `settings.gradle[.kts]` file will allow you to filter any kind of versions you don't want to know about. It can be handy to filter snapshots out for example.
- The new `rejectVersionIf { … }` predicate available in the `refreshVersions { … }` extension in your `settings.gradle[.kts]` file will allow you to filter any kind of versions you don't want to know about. It can be handy to filter snapshots out for example.
- Most of our dependency notations now provide more flexibility with 3 new extension functions: `withVersionPlaceholder()`, `withVersion(…)`, and `withoutVersion()`.

### Change (potentially breaking)
Expand Down
2 changes: 1 addition & 1 deletion docs/update-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ A perhaps better approach is to display development versions only if you are alr
}
```

`rejectVersionsIf { ...}` is pretty flexible, you can also use it to ban versions from specific version keys:
`rejectVersionIf { ...}` is pretty flexible, you can also use it to ban versions from specific version keys:

=== "settings.gradle.kts"
```kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ open class RefreshVersionsTask : DefaultTask() {

private fun warnAboutRefreshVersionsIfSettingIfAny() {
if (RefreshVersionsConfigHolder.isUsingVersionRejection) {
logger.warn("NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file.")
logger.warn("NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ internal actual data class VersionsPropertiesModel(

val isUsingVersionRejectionHeader = """
|####
|#### NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file.
|#### NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.
""".trimMargin()

private fun String.mustBeACommentLine() {
Expand Down
2 changes: 1 addition & 1 deletion sample-groovy/versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file
####
#### NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file.
#### NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.

plugin.org.gradle.hello-world=0.2

Expand Down
2 changes: 1 addition & 1 deletion sample-kotlin-js/versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file
####
#### NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file.
#### NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.

version.kotest=5.4.0

Expand Down
2 changes: 1 addition & 1 deletion sample-kotlin/versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file
####
#### NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file.
#### NOTE: Some versions are filtered by the rejectVersionIf predicate. See the settings.gradle.kts file.

plugin.org.jetbrains.kotlinx.benchmark=0.4.2

Expand Down