Discussion:
Obtaining EclipseProject and EclipseClasspath objects.
Alexander Kitaev
2012-04-24 19:39:05 UTC
Permalink
Hello,

I'm migrating our build plugin from milestone-3 to rc-1. Our build plugin
was patching Eclipse .project and .classpath generating code by modifying
GenerateEclipseClasspath and GenerateEclipseProject tasks.

Now, I'd like to modify EclipseProject and EclipseClasspath objects
properties. The question is how to get these objects from the build plugin?
I could locate "eclipse" task, but it does not contain "classpath" and
"project" properties.

How could I get those objects (EclipseProject and EclipseClasspath)
programmatically?

Thanks!

--
View this message in context: http://gradle.1045684.n5.nabble.com/Obtaining-EclipseProject-and-EclipseClasspath-objects-tp5663105p5663105.html
Sent from the gradle-user mailing list archive at Nabble.com.
Adam Murdoch
2012-04-24 21:40:29 UTC
Permalink
Post by Alexander Kitaev
Hello,
I'm migrating our build plugin from milestone-3 to rc-1. Our build plugin
was patching Eclipse .project and .classpath generating code by modifying
GenerateEclipseClasspath and GenerateEclipseProject tasks.
Now, I'd like to modify EclipseProject and EclipseClasspath objects
properties. The question is how to get these objects from the build plugin?
I could locate "eclipse" task, but it does not contain "classpath" and
"project" properties.
How could I get those objects (EclipseProject and EclipseClasspath)
programmatically?
Everything is reachable from the 'eclipse' extension added by the Eclipse plugin:

http://gradle.org/docs/current/dsl/org.gradle.api.Project.html#N107EA

So, you can do something like:

def eclipseProject = project.eclipse.project

or, from Java:

EclipseProject eclipseProject = project.getExtensions.getByType(EclipseModel.class).getProject();
Post by Alexander Kitaev
Thanks!
--
View this message in context: http://gradle.1045684.n5.nabble.com/Obtaining-EclipseProject-and-EclipseClasspath-objects-tp5663105p5663105.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Loading...