安装ant需要配置好java环境,配置好后,进入源代码中(/usr/local/ant)
./build.sh
..........
compile-tests:
test-jar:
BUILD FAILED
/usr/local/ant/build.xml:1021: The following error occurred while executing this line:
/usr/local/ant/build.xml:817: We cannot build the test jar unless JUnit is present,
as JUnit is needed to compile the test classes.
Total time: 4 seconds
... Failed Building Ant Distribution !
Bootstrap FAILED
需要junit的dependence
下载junit.jar
http://sourceforge.net/projects/junit/files/junit/4.8.1/junit-4.8.1.jar/download
cp junit-4.8.1.jar /usr/local/ant/lib/optional/
也可以吧junit.jar 放入classpath中
cd /usr/local/ant/lib/optional/
mv junit-4.8.1.jar junit.jar
cd /usr/local/ant/
./build.sh
.................
BUILD SUCCESSFUL
Total time: 6 seconds
编译成功
在文件夹内,产生一个dist文件,这就是编译好的需要用的文件
设置环境变量
cd
vi .bash_profile 加入
ANT_HOME=/usr/local/ant/dist
PATH=$PATH:$ANT_HOME/bin
export ANT_HOME
export PATH
重新登录
执行ant
Buildfile: build.xml does not exist!
Build failed
安装成功
建立build.properites 内容为 executable=php
<property file="build.properites"/>
<exec executable="${executable}">
<arg line="test.php"/>
</exec>
注意php必须写入环境变量中
ant编译php
最新推荐文章于 2024-08-13 22:56:27 发布