Skip to content

Commit

Permalink
refactor version ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Feb 3, 2025
1 parent d653afa commit dae57c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ final String junitVersion = "5.11.4"
final String jmhVersion = "1.37"
final String bcVersion = "1.80"

final String requires = "[2.1, " + gsonVersion + "]" // cap the require at the preferred version
final String runtimeRange = "[2.1,)" // allow later versions at runtime
final String minRuntimeGson = "2.1" // allow later versions at runtime
final String requires = "[" + minRuntimeGson + ", " + gsonVersion + "]" // cap the require at the preferred version

dependencies {
implementation("com.google.code.gson:gson:" + gsonVersion) {
Expand All @@ -105,7 +105,7 @@ dependencies {
constraints {
implementation("com.google.code.gson:gson:") {
version {
require(runtimeRange) // published in "dependencyConstraints" / "<dependencyManagement>"
require("[" + minRuntimeGson) // published in "dependencyConstraints" / "<dependencyManagement>"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
//val junitVersion = "5.11.4"
//val bcVersion = "1.80"
//
//val requires = "[2.1, " + gsonVersion + "]" // cap the require at the preferred version
//val runtimeRange = "[2.1,)" // allow later versions at runtime
//val minRuntimeGson = "2.1" // allow later versions at runtime
//val requires = "[$minRuntimeGson, $gsonVersion]" // cap the require at the preferred version
//
//dependencies {
// implementation("com.google.code.gson:gson:$gsonVersion") {
Expand All @@ -92,7 +92,7 @@
// constraints {
// implementation("com.google.code.gson:gson:") {
// version {
// require(runtimeRange) // published in "dependencyConstraints" / "<dependencyManagement>"
// require("[$minRuntimeGson") // published in "dependencyConstraints" / "<dependencyManagement>"
// }
// }
// }
Expand Down

0 comments on commit dae57c3

Please sign in to comment.