Skip to content

Conversation

@malliaridis
Copy link

Description

Gradle provides an option --write-locks that is explicitly "disabled" when using this plugin. This prevents the execution of gradlew --write-locks. Migrating from tools like palantir's consistent versions or using bots like renovatebot requires additional project configurations to support dependency locking.

Solution

The current solution adds the writeLocks task as a DefaultExecutionRequest if --write-locks is provided. This is similar to replacing --write-locks with writeLocks in the arguments passed to gradle.

The solution supports the following commands:

./gradlew --write-locks # used usually by users and custom scripts
./gradlew :dependencies --write-locks # used by renovatebot
./gradlew [any-other-task] --write-locks
./gradlew :writeLocks

Additional Notes

The commit history contains an alternative implementation that supports gradlew --write-locks by registering writeLocks as a default task. This implementation however would not execute the task if a task is passed, like in case of gradlew :dependencies --write-locks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant