Hi Gabi,

On Fri, Jan 15, 2010 at 1:57 PM, gdogaru <[email protected]> wrote:
>
> Hi
> My build environment uses a lib to set itself up.
> I am able to call it by using
>
> dependencies {
>  run group: 'me', name: 'buildtools', version: '1.0-SNAPSHOT'
> }
>
> and in my task I call
>
> ant.java(classname: "com.synygy.buildtools.env.SetupReportsRepository",
> failonerror: "true", fork: "true") {
>    classpath(refid = configurations.run.asPath)
>    arg(line: "args")
> }
>
> I was wondering if there was a way to replace the call with
>
> new com.synygy.buildtools.env.SetupReportsRepository(....).execute()
> eventually an import com.synygy.buildtools.env.SetupReportsRepository on top

The following should do the job:

import com.synygy.buildtools.env.SetupReportsRepository

buildscript {
   repositories { ... }
   dependencies {
      classpath  group: 'me', name: 'buildtools', version:
'1.0-SNAPSHOT' // alternatively "me:buildtools:1.0-SNAPSHOT"
  }
}

new SetupReportsRepository(....).execute()

Gradle does some magic that the buildscript closure is evaluated
before the rest of the build script is compiled.

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz



>
> Thanks, Gabi
> --
> View this message in context: 
> http://old.nabble.com/directly-call-classes-from-a-jar-tp27174849p27174849.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply via email to