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
5 tasks
donat opened this issue Feb 4, 2017 · 13 comments
Closed
5 tasks

Run tasks when Eclipse build is triggered #266

donat opened this issue Feb 4, 2017 · 13 comments

Comments

@donat
Copy link
Contributor

donat 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
Copy link
Contributor

lukeu 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
Copy link
Member

oehme 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
Copy link
Contributor

lukeu 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
Copy link
Member

oehme commented Apr 20, 2017

Yes, that's covered by #265

@lukeu
Copy link
Contributor

lukeu 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
Copy link

@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
Copy link
Contributor

lukeu 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
Copy link

Are there any plans to implement this enhancement?

@donat
Copy link
Contributor Author

donat 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
Copy link

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
Copy link

Same here considering the eclipse and eclipse-wtp tasks.

@Frontrider
Copy link

It's a requirement for us right now.

@donat donat self-assigned this Apr 8, 2019
@donat
Copy link
Contributor Author

donat commented Apr 12, 2019

Also implemented as part of #871.

@donat donat closed this as completed 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
Projects
None yet
Development

No branches or pull requests

8 participants