The 'application' plugin (
http://gradle.org/current/docs/userguide/application_plugin.html) might work
for you. If not, see JavaExec task (
http://gradle.org/current/docs/dsl/org.gradle.api.tasks.JavaExec.html).

LT

2011/5/2 Russ Rollins <[email protected]>

> I've been thinking about several Gradle projects that I have on the horizon
> and wondering about creating a task/plugin common to the projects that
> would:
> 1. define a specific set of compile and runtime dependencies
> 2. compile the code (groovy, scala, java)
> 3. execute a main() on one of the compiled classes with the appropriate
> classpath as defined in step #1
>
> This scenario would alleviate the current (inefficient prototype) approach
> of generating multiple jars (one library, another standalone including all
> the deps) and subsequently invoking the standalone jar in a separate process
> after Gradle completes the jar task. I've just jumped back into Gradle after
> nearly a year of being on another project and thus wondered what additional
> steps would be needed to complement:
>
> task runMain(dependsOn: compileScala) <<{
>   //build classpath
>   //execute main on some target class
> }
>
>
> TIA,
> -Russ-
>
>

Reply via email to