ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "edumudi.viswanath@oracle.com" <edumudi.viswan...@oracle.com>
Subject problem with macrodef in ant
Date Tue, 28 Jul 2009 13:31:55 GMT
Hi Friends,

I have macrodef in build.xml & it took parameters like wsdlfile & bindingfile from
wsdl2java tag ie <wsdl2java file="wsdlfile1" bindingfile="bindingfile1" />. 

Now, If I run macrodef with wsdlfile1 & bindingfile1, It works asusually.

But if I run same macrodef again with wsdlfile2 & bindingfile2, In that case it taking
previous bindingfile1 instead of new given buildingfile2.

Below I provided macrodef & I am calling macrodef with target name=" generate.service"
and target name=" generate.service1" respectively.


1)	<macrodef name="wsdl2java">
        <attribute name="srcdestdir" default="${pojoSourceDir}"/>
        <attribute name="destdir" default="${buildDir}"/>
        <attribute name="file"/>
        <attribute name="servicename.arg" default=""/>
        <attribute name="bindingfile" />
                <attribute name="exshvalue" default="true"/>
        <attribute name="dir" default="${wsdlDir}"/>
        <attribute name="package" default="NOT_SPECIFIED"/>
        <sequential>
            <mkdir dir="@{destdir}"/>
            <mkdir dir="@{srcdestdir}"/>

            <condition property="package.arg.@{file}" value="-p @{package}">
                <not>
                    <equals arg1="@{package}" arg2="NOT_SPECIFIED"/>
                </not>
            </condition>
            <property name="package.arg.@{file}" value=""/>

                        <condition property="binding.arg" value='-b "@{bindingfile}"'>
                                <not>
                                    <equals arg1="@{bindingfile}" arg2=""/>
                                </not>
                            </condition>
                            <property name="binding.arg" value=""/>

                        <condition property="exsh.arg" value='-exsh  "@{exshvalue}"'>
                        <not>
                            <equals arg1="@{exshvalue}" arg2=""/>
                        </not>
                        </condition>
                        <property name="exsh.arg" value=""/>

            <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava"
fork="yes">
                <classpath>
                    <path refid="cxfClassPath" />
                </classpath>
                <sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/>
                <sysproperty key="exitOnFinish" value="true"/>
                <arg line="@{servicename.arg}"/>
                <arg line="${package.arg.@{file}}"/>
                <arg line="${binding.arg}"/>
                                <arg line="${exsh.arg}"/>
                <arg value="-verbose"/>
                <arg value="-d"/>
                <arg value="@{srcdestdir}"/>
                <arg value="@{dir}/@{file}"/>
            </java>
        </sequential>
    </macrodef>
        

 2)       <target name="generate.service" depends="generate.esfconfig">
        <wsdl2java file="wsdlfile1" bindingfile="buildingfile1" />
        </target>

 3)      <target name="generate.service1" depends="generate.esfconfig">
        <wsdl2java file="wsdlfile2" bindingfile="buildingfile2" />
	  </target>

Please help me to solve this issue.

Thanks & Regards,
vishy


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message