On 20/01/2012, at 5:33 AM, k4rn4k wrote:

> Hello,
> 
> I have an old program which synchronizes pom.xml with some other settings
> files. As we are moving to gradle I would like to reuse the program but
> instead of parsing the "build.gradle" archive I find more handy passing the
> data during the configuration phase of gradle. 
> 
> Doing something like:
>  GradleData gd= new GradleData()
>  gd.setName= project.name
> 
> This way I would have to rewrite just a minimal part of the code instead of
> coding a whole new parser. 
> 
> so my question is:
> 
> Is there a way to instantiate a java class from gradle ? 

Have a look at: 
http://gradle.org/docs/current/userguide/organizing_build_logic.html#sec:external_dependencies

You can add your existing classes to the build script classpath, and then just 
write code in the build script to use it.

> 
> A way to instantiate a groovy class would work also. 
> 
> Thanks. 
> 
> 
> 
> --
> View this message in context: 
> http://gradle.1045684.n5.nabble.com/Instantiate-groovy-and-java-class-from-gradle-tp5158532p5158532.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
> 
> 


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to