Open mwos-sl opened 4 years ago
As mentioned - I already implemented it and using with luck, using also this PR: https://github.com/gradle/gradle-completion/pull/89
Hi, everyone :)
Any news about this? It really would help me :)
To "fix" the issue, I edit the Gradle script oh-my-zsh/plugins/gradle/_gradle
to run ./gradlew tasks
instead ./gradlew tasks --all
, so this way I could get only the project tasks and not each module task. But would be good to get all of them.
I also need to delete the cache of my project, deleting the content of .gradle/completion/
Let me know if I could help with something else. :)
Curent behaviour:
Currently generating cache uses
gradle tasks --all
, which: 1) does not return unqualified tasks (tasks that are in subprojects but available without typing subproject name) 2) includes hidden tasks 3) does not allow to configure visibility of tasks other than setting group to null (but even this one is not supported bygradle-completion
, because--all
does not care..)After the command returns a list, additional parsing is done on the script side.
Proposal:
Replace generating cache with configurable gradle task, that creates cache in the final format. Parameters:
...and also list of Clousures with post processors, to modify the final result easily with project specific stuff (e.g. rules).
It gives a total freedom what should be supported in gradle-completion and what should not. It would store directly to pointed cache file set a parameter too. Example configuration in
build.gradle
:and invoking:
I already implemented it. My plan is, to change
gradle-completion
scripts in a way, that if they discover.gradle-completion
dir in a given project, it would source some files, that would override default behaviour. In particular default command, so that it's possible to replace with my custom task for generating report.What do you think about it? Would you be interested in: a) such gradle task / plugin to be added to this repository b) eventually replacing
gradle tasks --all
with it c) more generic scripts that allow overriding default behavious. In particular gradle cmd.Proposed generating cache is faster comparing to the original one.