Adam Murdoch schrieb:


On 31/03/10 2:56 AM, Rene Groeschke wrote:
Hi jan,

I think at the moment you have to do this manually in your build script.
I've added aspectj nature to my project with the following lines in my
build script:
-----

eclipseProject.doLast {
    def projectFile = project.file(eclipseProject.PROJECT_FILE_NAME)

     def reader = new org.dom4j.io.SAXReader()
     def doc = reader.read(projectFile)
def builders = doc.selectSingleNode('/projectDescription/buildSpec')
    def buildCommandElement = builders.addElement('buildCommand')
buildCommandElement.addElement('name').addText('org.eclipse.ajdt.core.ajbuilder')
    buildCommandElement.addElement('arguments')


      def natures = doc.selectSingleNode('/projectDescription/natures')
natures.addElement('nature').addText('org.eclipse.ajdt.ui.ajnature') // Eclipse pulls the decoration from the first nature. Make groovy be first.
     natures.setContent(natures.content().reverse())

     def writer = new org.dom4j.io.XMLWriter(projectFile.newWriter(),
org.dom4j.io.OutputFormat.createPrettyPrint())
     writer.write(doc)
     writer.close()
}

-----

not that groovy yet, but it works.

I think you could use instead:

eclipseProject {
    natures += 'org.eclipse.ajdt.ui.ajnature'
    buildCommands += 'org.eclipse.ajdt.core.ajbuilder'
}

Have a look at: http://gradle.org/0.9-preview-1/docs/javadoc/org/gradle/api/tasks/ide/eclipse/EclipseProject.html

definitely more elegant. thx. will test this tomorrow.

--
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to