[GRADLE-1572] The current EclipseModel does not allow to define additional tasks like eclipseJdt Created: 24/May/11  Updated: 04/Jan/13  Resolved: 15/Mar/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-3
Fix Version/s: None

Type: Bug
Reporter: Thomas Glaeser Assignee: Unassigned
Resolution: Won't Fix Votes: 2


 Description   

There is a need for an extensible eclipse model that supports, or would allow to add additional tasks, for the generation of additional property files

  • .settings/org.eclipse.core.resources.prefs
  • .settings/org.eclipse.pde.core.prefs
  • ...

Adding such tasks seems to conflict with the eclipseJdt task, resulting in the following error

:foo:eclipseJdt

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':foo:eclipseJdt'.
Cause: object is not an instance of declaring class

While the system is flexible to configure the existing tasks, there seems to be no way right now for adding additional tasks.



 Comments   
Comment by caiweiwei [ 10/Jan/12 ]

http://gradle.1045684.n5.nabble.com/Additional-Gradle-Eclipse-Plugin-Tasks-td4338839.html

Comment by Szczepan Faber [ 15/Mar/12 ]

Hello Thomas,

You can create any number of tasks that generate some custom Eclipse metadata and hook them up to eclipse via (just an example):

tasks.eclipse.dependsOn([generateResourcesPrefs, generateCorePrefs])

Similarly, you can hook up cleanXxx takss to cleanEclipse

Current gradle contains abstract class PropertiesGeneratorTask that can be useful for generating files based on properties. Even without that, generating a file is very straightforward in groovy.

I'm inclined to close that issue because there is a natural way of solving the problem using standard Gradle features. Chance is I don't understand the use case well enough Feel free to comment or reopen.

Generated at Wed Jun 30 11:58:57 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.