ref: useguide 2.8
I am trying to use the groovy.xml.NamespaceBuilder on the supplied ant
instance as documented in
http://groovy.codehaus.org/Using+Ant+Libraries+with+AntBuilder :
import groovy.xml.NamespaceBuilder
def dn = NamespaceBuilder.newInstance(ant, "antlib:org.apache.ant.dotnet")
this does not produce any errors, however it does not execute tasks with dn.
To make a task execute I have to instantiate a new AntBuilder:
def ant1 = new AntBuilder() // somehow the provided default ant property
does not execute
def dn = NamespaceBuilder.newInstance(ant1, "antlib:org.apache.ant.dotnet")
What am I doing wrong?
Also, is there a way to prevent the addition of
xmlns="antlib.org.apache.ant.dotnet" when not using a build file?
build.gradle part:
dn.msbuild {
target(Name: 'echo')
build {
Project(ToolsVersion: '3.5',
xmlns:
'http://schemas.microsoft.com/developer/msbuild/2003') {
target(Name: 'echo') {
Message(Text: version)
}
}
}
}
outputs:
<?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="3.5"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
xmlns="antlib:org.apache.ant.dotnet">
<target Name="echo">
<Message Text="0.0.1-SNAPSHOT" />
</target>
</Project>
(xmlns attribute gets added twice)
--
View this message in context:
http://www.nabble.com/Questions-on-using-libraries-with-AntBuilder-and-NamespaceBuilder-tp21973989p21973989.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