A nested XML element translates to a nested block (closure) in Groovy:

myApt(preprocessdir: "java", ...) {
  option(name: "module.root.dir", ...)
}

PS: Your posts are only visible on Nabble, but haven't been accepted by the
mailing list. In any case, you should use the new forum instead
(http://forums.gradle.org).

--
Peter Niederwieser
Principal Engineer, Gradleware 
http://gradleware.com
Creator, Spock Framework 
http://spockframework.org
Twitter: @pniederw




bruce wrote:
> 
> Right now, I have below ant APT task
> <apt preprocessdir="${src.dir}" compile="false"
>              srcdir="${src.dir}"
>              destdir="${out.prod.dir}"
>              classpathref="build.classpath"
>             
> factory="com.xxx.presentation.annotations.TagProcessorFactory"
>              fork="true" source="1.5" memoryMaximumSize="512M"
> includeantruntime="false">
> 
>             *<option name="module.root.dir" value="${module.root.dir}"/>*
>             <option name="fileName" value="myvalue"/>
>   </apt>
> 
> I am trying to move to gradle:
> task APT  << {
>    ant{
>       taskdef(name:'myAPT',
> classname:'*org.apache.tools.ant.taskdefs.Apt*',classpath:configurations.compile.asPath)
>  
>       myAPT(preprocessdir:'java',compile:'false',srcdir:'java',
> destdir:'build/classes/main',
>            
> factory:'com.xxx.presentation.annotations.TagProcessorFactory',
> fork:'true', 
>             source:'1.5', memoryMaximumSize:'512M',
> includeantruntime:'false', *option:['name','module.root.dir']*){
>         
>       }
>    }
> }
> 
> I got the error: *The <myAPT> type doesn't support the "option"
> attribute.*  
> 
>  Can anybody help me please? Thanks a lot.
> 


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Migrate-ant-APT-task-to-gradle-problem-tp4925349p4925906.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


Reply via email to