We are happy to announce that Buildship 3.1 has just been released. The highlight of this release is the “Run tasks upon synchronization” story, which is the highest voted issue in the project’s bug tracker. The full list of changes is available here.
Run tasks on synchronization
Since Gradle 5.4, projects can declare an arbitrary set of tasks in the eclipse.synchronizationTasks configuration. Once configured, Gradle will automatically execute those tasks every time the user synchronizes workspace with the build.
I got the synchronizationTasks feature to work in my project. That’s going to be a big win for our dev team.
WRT the autoBuildTasks feature, can you explain a bit about what the phrase “every time the Eclipse auto-build” means? I used to know a bit more about the Eclipse builder architecture than I remember now, but IIRC the builder runs only relatively infrequently and, for example, not when I’m just editing Java source files. And I know it runs when you do a “Project > Clean”. But other than that, I’m hazy on when it runs.
Like other projects, our Gradle build generates Java source files. The inputs into that source generation process are themselves Java source files. Ideally, whenever one edits and saves one of those input files in Eclipse, the Gradle task that does the generation process would run. However, even when I added the appropriate autoBuildTasks directive, that doesn’t happen. So either I’m misunderstanding the extent of the feature’s capability, or I’m doing something wrong.
Actually, it should happen quite frequently. Buildship launches autoBuildTasks every time a resource changes within the project and Project > Build Automatically Eclipse menu item is enabled. Did you turn off the option?
For whatever reason my use of autoBuildTasks appears to be resulting in exactly nothing ever happening.
I do have Project > Build Automatically enabled. As an experiment, I turned it off and then did Project > Build on the project that uses autoBuildTasks. Still the Gradle build task didn’t run.
Is there some logging or other mechanisms I can enable to see what might be going on?