Skip to content

Commit

Permalink
Merge pull request #689 from Vampire/fix-reject-version-if
Browse files Browse the repository at this point in the history
Fix rejectVersionsIf vs. rejectVersionIf
  • Loading branch information
jmfayard committed Jul 6, 2023
2 parents 438fa08 + 8878121 commit 77e4c0d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 8 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,4 @@ androidx.health..health-connect-client=version.androidx.health-connect-client
com.google.accompanist..accompanist-glide=version.google.accompanist
com.google.accompanist..accompanist-imageloading-core=version.google.accompanist
app.cash.molecule..molecule-testing=version.app.cash.molecule
androidx.compose.runtime..runtime-tracing=version.androidx.compose.runtime
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ androidx.compose.runtime..runtime-livedata=version.androidx.compose.runtime
androidx.compose.runtime..runtime-rxjava2=version.androidx.compose.runtime
androidx.compose.runtime..runtime-rxjava3=version.androidx.compose.runtime
androidx.compose.runtime..runtime-saveable=version.androidx.compose.runtime
androidx.compose.runtime..runtime-tracing=version.androidx.compose.runtime
androidx.compose.runtime..runtime-tracing=version.androidx.compose.runtime-tracing
androidx.compose.runtime..runtime=version.androidx.compose.runtime
androidx.compose.ui..ui-geometry=version.androidx.compose.ui
androidx.compose.ui..ui-graphics=version.androidx.compose.ui
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

0 comments on commit 77e4c0d

Please sign in to comment.