-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate
dependencies.yml
to Gradle's version catalogs (#4353)
Motivation: We can declare dependency versions using `dependencies.yml` and share them across multiple projects. It is useful to manage the versions of various dependencies. However, we can't define different versions of a module. Because the unique keys in `dependencies.yml` are `moduleId:artifactId`. This limitation makes it difficult to manage compatibility between different versions of a library. For example, okhttp v4 is required to test `it:okhttp` and okhttp v3 is required to run `retrofit2` module. Gradle introduced a new way to [share dependency versions between projects](https://docs.gradle.org/current/userguide/platforms.html). The unique key of version catalogs is a user-defined alias so we can define multiple versions of a module using different aliases. Version catalogs do not allow extra properties on `libs.versions.toml`. It only allows some properties for versions and modules. `dependencies.yml` not only manages versions but also manages metadata for a module such as relocations, exclusions and Javadoc links. I wanted to take advantage of both. We need a version manager that supports version catalogs based on aliases, and the ability to add the metadata. As a result, I implemented to add our own dependency mechanism using `dependencies.toml` that is fully compatible with Gradle's version catalogs and understands relocations, exclusions and Javadoc links declarations. Modifications: - Migrate `dependencies.yml` to `dependencies.toml` - Rename `common-dependences.gradle` to `common-dependences-lagacy.gradle` for backward compatibility with `dependencies.yml` - Newly added `common-dependences.gradle` handles the dependencies declared by `dependencies.toml` - Add `version-catalog.gradle` that parses `dependencies.toml` and builds: - Library and BOM version catalogs - relocations - exclusions - Javadoc links - Migrate all dependencies defined in `build.gradle` files to the new version catalog API. Result: Fixes #4120
- Loading branch information
Showing
107 changed files
with
2,294 additions
and
1,524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dependencies { | ||
testImplementation 'org.jooq:joor' | ||
testImplementation libs.joor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
dependencies { | ||
api 'io.zipkin.brave:brave' | ||
api 'io.zipkin.brave:brave-instrumentation-http' | ||
api libs.brave | ||
api libs.brave.instrumentation.http | ||
|
||
testImplementation project(':thrift0.16') | ||
testImplementation 'io.zipkin.brave:brave-context-slf4j' | ||
testImplementation 'io.zipkin.brave:brave-instrumentation-http-tests' | ||
testImplementation libs.brave.context.slf4j | ||
testImplementation libs.brave.instrumentation.http.tests | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
dependencies { | ||
// Bucket4j - rate-limiting library based on Token-Bucket algorithm | ||
implementation 'com.github.vladimir-bukhtoyarov:bucket4j-core' | ||
implementation libs.bucket4j | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.