"gradle tasks" could be "up-do-date" and show the same task set immediately


(parmegv) #1

Trying to add gradle support to Emacs CEDET android.el, I want to provide autocompletion of gradle tasks.

The problem is that “gradle tasks” command must be executed everytime autocompletion set has to be presented, and that’s an huge waste of time (and patience).

Since gradle itself supports “up-to-date” tasks, and according to the user guide they check if the inputs and outputs are the same, I think we could implement an “up-to-date” result for the “gradle tasks” command. If I’m not wrong, we need to set the task inputs as all build.gradle files and settings.gradle (I don’t know if any other file), and that should be enough for gradle to detect if they have been changed or not (thus tasks remain the same or not).


(Luke Daley) #2

Hi,

Unfortunately it isn’t that simple. There’s nothing stopping someone doing this…

if (todayIsMonday()) {
  task someTask {}
}

That is, there are more inputs into the task model than just text content of the files.

We are making steps towards making this work though. Right now Gradle supports incrementally building file outputs. We are working towards adding support for incrementally built models. This is a very deep change and will enable much greater performance and other good stuff. However, it’s not going to happen overnight. It’s also lots of pieces of work, so there is no single JIRA ticket or issue.

All I can say right now, that hopefully helps, is that you will see this kind of goodness rolling in over the coming releases.