On Thu, 2010-04-29 at 17:38 -0600, Kurt Harriger wrote: > I'm interested in the idea of using Gradle and Ivy to build C# projects. [ . . . ]
I think having a C# plugin for Gradle would be very valuable.
What is also needed is quality C and C++ support in Gradle so as to be
able to build mixed Java/Scala/Groovy/C/C++ systems. Anyone watching
the SCons mailing list will see that the converse argument (SCons needs
significantly better Java/Scala/Groovy support than it currently has) is
taking place and some activity may happen.
[ . . . ]
> I actually use gradle now for some of my C# projects but without any
> plugins, however I can't figure out for the life of me how to perform
> the equivalent Gant script in Gradle.
As far as I am aware, Hans' assertion that any Gant script can be
written in Gradle is actually true. All the Gant scripts I have
converted have gone over quite easily.
> The basic gant script looks a bit like this:
>
> includeTool << gant.tools.Ivy
>
> target( name : 'resolve' ) {
> ivy.resolve()
> }
> target( name : 'retrieve' ) {
> depends ( resolve )
> // This pattern strips version number
> // and places resources in correct folder
> ivy.retrieve( pattern : "lib/([culture]/)[artifact].[ext]" )
> }
>
> // compile, etc
>
> target ( name : 'publish' ) {
> depends ( resolve )
> ivy.publish ( resolver : "ivysvn", forcedeliver : "true") {
> artifacts ( pattern : "bin/([culture]/)[artifact].[ext]" )
> }
> }
Crickey, I didn't know anyone was actually using the Ivy adaptor in
Gant. Do submit JIRA issues if you find any problems.
[ . . . ]
> I can't figure out how to express this in Gradle nor can I figure out
> how to express this in Gradle.
>
> I don't mind having the ivy.xml files in addition to the gradle build
> and calling the ivy tasks using ant builder, but I'm having trouble
> figuring out how to even do that but I'm pretty sure this should be
> possible even if not very Gradle like but better than going back to Gant
> I would think.
>
> Any suggestions?
I guess the issue here is the gant.tools.Ivy code. It provides an
adaptor to the Ivy jar. Gradle must have an equivalent as it uses Ivy
internally, but this hasn't been exposed as a plugin or API for Gradle
scripts to use. The gant.tools.Ivy code is very simple so as a last
resort just transform it into code that can work in your Gradle script?
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
