Hi,

Something like this should do what you want:

createTask('run', dependsOn: 'compile') {
    ant.java(classname: 'MainClassName') {
        classpath(path: dependencies.antpath('runtime'))
        classpath(path: classesDir)
    }
}

You can then execute 'gradle run' to compile and run the main class.


Adam

Johannes Zillmann wrote:
Hi there,

i have a project with a gradle build (JavaProject plugin).
Is it possible to start the main class of the project from a custom gradle task ?
With all the dependencies and resources in classpath ?

Johannes

PS: i wanted to send this mail to the users list, so i sent a subscribe mail. Have done this yesterday evening (and again 5 minutes before) but got no response yet...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec GmbH
Halle (Saale), Saxony-Anhalt, Germany

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec GmbH
Halle (Saale), Saxony-Anhalt, Germany

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to