-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(build): Implement dependency locking using gradle convention plugin * feat(ci): Update version locks on nightly builds
- Loading branch information
1 parent
b792b2d
commit 86a24ac
Showing
4 changed files
with
39 additions
and
26 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
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
32 changes: 32 additions & 0 deletions
32
buildSrc/src/main/kotlin/datadog.dependency-locking.gradle.kts
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* This plugin enables dependency locking. | ||
* | ||
* The goal is to be able to later rebuild any version, by pinning floating versions. | ||
* It will also help IDEs not having to re-index any latest library release. | ||
* Pinned versions will be updated by the CI on a weekly basis. | ||
* | ||
* Pinned version can be updated using: ./gradlew resolveAndLockAll --write-locks | ||
* | ||
* See https://docs.gradle.org/current/userguide/dependency_locking.html | ||
*/ | ||
|
||
project.dependencyLocking { | ||
lockAllConfigurations() | ||
//lockmode set to LENIENT because there are resolution | ||
//errors in the build with an apiguardian dependency. | ||
//See: https://docs.gradle.org/current/userguide/dependency_locking.html for more info | ||
lockMode = LockMode.LENIENT | ||
} | ||
|
||
tasks.register("resolveAndLockAll") { | ||
notCompatibleWithConfigurationCache("Filters configurations at execution time") | ||
doFirst { | ||
require(gradle.startParameter.isWriteDependencyLocks) | ||
} | ||
doLast { | ||
configurations.filter { | ||
// Add any custom filtering on the configurations to be resolved | ||
it.isCanBeResolved | ||
}.forEach { it.resolve() } | ||
} | ||
} |
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,2 +1,4 @@ | ||
apply plugin: 'datadog.dependency-locking' | ||
|
||
apply from: "$rootDir/gradle/java_deps.gradle" | ||
apply from: "$rootDir/gradle/java_no_deps.gradle" |