简体   繁体   中英

Trouble passing argument to Ant exec task

I'm using Ant 1.8. I want to pass a property that I define in my script to an exec command. Although I can see the property has a value in my echo statements, when I pass it to the script and output its value in the script, its value prints out as "${myco.test.root}", without being converted. What is the correct way to pass the property's value to the script? Below is the relevant code from my build.xml file …

<target name="checkout-selenium-tests" depends="set-critical-path-test-suite,set-default-test-suite,check-local-folders-exist">
<echo message=" test root ${myco.test.root}" />
<stcheckout servername="${st.servername}"
    serverport="${st.serverport}"
            projectname="${st.myco.project}"
            viewname="${st.myco.viewname}"
            username="${st.username}"
            password="${st.password}"
            rootstarteamfolder="${myco.starteam.test.root}"
            rootlocalfolder="${myco.test.root}"
            forced="true"
            deleteuncontrolled="true"
    />


    <delete file="${myco.testsuite.file}" />
    <echo message="test root ${myco.test.root}" />
    <exec failonerror="true" executable="perl" dir="${scripts.dir}">
            <arg value="generate_test_suite.pl" />
            <arg value="My Tests" />
            <arg value="${myco.test.root}" />
            <arg value="${myco.testsuite.file}" />
    </exec>
</target>

Thanks, - Dave

It actually looks good to me. Try running the build.xml with both the verbose and debug options turned on in Ant:

ant -d -v checkout-selenium-tests

That'll help trace down where the error could be coming from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM