Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "gradlew --write-locks" #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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