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

Run tasks when Eclipse build is triggered #266

Closed
donat opened this issue Feb 4, 2017 · 13 comments

Comments

Projects
None yet
8 participants
@donat
Copy link
Contributor

commented Feb 4, 2017

Issue by oehme
Thursday May 19, 2016 at 15:21 GMT


Motivation

People often have little code generators in their build for which there is no Eclipse support. But thanks to Gradle's performance, running tasks on every Eclipse auto-build is feasible.

Proposed Change

Add eclipse.autoBuildTasks, expose them via the TAPI and let the Buildship builder run them on every auto-build of the project.

Code review

  • Does the change work?
  • Is the change sufficiently tested?
  • Is the public API modification handled appropriately?
  • Is it sufficiently documented?
  • Is it implemented well?

See also the full checklist.

@lukeu

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2017

I could also imagine it being useful (and slick) if those same code generation steps could run as part of a manual build-all (Ctrl+B). Would that also be enabled by this?

(I don't use auto-build: I like to be in control of when I hot-swap changes into a debugged application, among other reasons.)

@oehme

This comment has been minimized.

Copy link
Member

commented Apr 8, 2017

Yes, the term auto-build is a little misleading here: It would work whenever the builder is triggered, both manually and automatically.

@oehme oehme changed the title Run tasks on auto-build Run tasks when Eclipse build is triggered Apr 8, 2017

@lukeu

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

I thought I'd mention a use-case that might be relevant. Currently getting Eclipse to compile is a 3-step process for us, as we generate source files outside of the project directory.

  1. gradle generateSources
  2. Right-click Project > Gradle > Refresh Gradle Project
  3. Build (Ctrl+B)

Step 2 is required because if the externally-generated folders don't exist, Buildship will not have constructed (or updated) linked-resources into the Eclipse projects to use as source folders.

Do you envisage it being possible (or desirable) to automate step 2 via the eclipse.autoBuildTasks proposal?

@oehme

This comment has been minimized.

Copy link
Member

commented Apr 20, 2017

Yes, that's covered by #265

@lukeu

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

Great thanks. Right so maybe eclipse.synchronizationTasks could just construct the gen-src dir, ensuring it exists prior to project-sync; then eclipse.autoBuildTasks for the code-gen? I can imagine that would work nicely.

@ericnondahl

This comment has been minimized.

Copy link

commented Apr 20, 2017

@lukeu We have a similar use case, and committed the empty generated source folders that can be added to the eclipse project model so that the full Refresh Gradle Project is not needed - just an eclipse refresh to pull in the new sources. Just throwing that out there in case it is helpful in the short term before builder support is added to buildship - removes having to do a repeated Gradle project import after the sources are generated.

@lukeu

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

@ericnondahl Thanks for the tip. In our case it's to a non-repo directory (and in my specific case, a different drive. This fits in with our GNU-make parts of the build, and I gather is useful in our CI setup.) Still, the generated-source folders don't change often so the 3 steps would be done fairly infrequently & is no biggie for me now that I've figured out what's going on. (I'm getting good at it - I toggle my 30-module workspace between Maven and Buildship about once daily while we're transitioning!) My interest here is more in seeing Buildship grow even slicker - ideally zero configuration (for other team members who don't want to dive deep into Gradle, and when the build structure changes in the future.)

@eximius313

This comment has been minimized.

Copy link

commented Aug 29, 2017

Are there any plans to implement this enhancement?

@donat

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2017

@eximius313 Yes, we still want to implement this. Currently, we have other priorities (like #354), but we'll consider this feature in our next planning meeting.

@ChristianCiach

This comment has been minimized.

Copy link

commented Jun 18, 2018

We need this to automatically trigger eclipseFactorypath and eclipstJdtApt of the APT-Plugin. There is no way that I convince all my colleagues to manually run these tasks every time the factory path changes.

@Gentleman1983

This comment has been minimized.

Copy link

commented Jun 21, 2018

Same here considering the eclipse and eclipse-wtp tasks.

@Frontrider

This comment has been minimized.

Copy link

commented Sep 4, 2018

It's a requirement for us right now.

@donat donat self-assigned this Apr 8, 2019

@donat

This comment has been minimized.

Copy link
Contributor Author

commented Apr 12, 2019

Also implemented as part of #871.

@donat donat closed this Apr 12, 2019

@donat donat added this to the Buildship 3.1 milestone Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.