1. 程式人生 > >ant呼叫 shell指令碼

ant呼叫 shell指令碼

編寫build.xml

<?xml version="1.0" encoding="utf-8" ?>
<project name="dy_cike_init" basedir=".">
    <target name="hait_cpr" description="">
        <exec executable="/bin/sh">
            <arg value="./cp_cike.sh"/>
        </exec>
    </target>
</project>

編寫cp_cike.sh
#!/bin/sh

echo "copy cike ok"

執行 ant   hait_cpr

ke_init/test_ant$ ant hait_cpr 
Buildfile: /mnt/d/work/android.dooyogame/dy_cike/dy_cike_init/test_ant/build.xml

hait_cpr:
     [exec] copy cike ok

BUILD SUCCESSFUL
Total time: 0 seconds