2424
2525Ant 是纯 Java 语言编写的,所以具有很好的跨平台性。
2626
27- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-d9da2a06160103d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
27+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-d9da2a06160103d0.png " /></div >
2828
2929## 下载和安装
3030
@@ -34,7 +34,7 @@ ant 的官方下载地址:http://ant.apache.org/bindownload.cgi
3434
3535进入页面后,在下图的红色方框中可以下载最新版本。笔者下载的版本是 ** apache-ant-1.9.4。**
3636
37- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-72d3bc81cd29e68d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
37+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-72d3bc81cd29e68d.png " /></div >
3838
3939### 配置环境变量
4040
@@ -44,15 +44,15 @@ ant 的官方下载地址:http://ant.apache.org/bindownload.cgi
4444
4545** ANT_HOME** C:/ apache-ant-1.9.4
4646
47- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-682a8e16b82a7532.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
47+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-682a8e16b82a7532.png " /></div >
4848
4949** path ** C:/ apache-ant-1.9.4/bin
5050
51- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-ea61070f97b5a7cc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
51+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-ea61070f97b5a7cc.png " /></div >
5252
5353** classpath** C:/apache-ant-1.9.4/lib
5454
55- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-5bc45dbe64602bc7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
55+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-5bc45dbe64602bc7.png " /></div >
5656
5757### 验证
5858
@@ -75,7 +75,7 @@ ant 的官方下载地址:http://ant.apache.org/bindownload.cgi
7575
7676输入 ** ant -version** ,可以查看版本信息。
7777
78- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-920e94f33b4d7dd9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
78+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-920e94f33b4d7dd9.png " /></div >
7979
8080但如果出现 'ant' 不是内部或外部命令,也不是可运行的程序或批处理文件,说明安装失败:(可以重复前述步骤,直至安装成功。)
8181
@@ -134,27 +134,27 @@ ant 的官方下载地址:http://ant.apache.org/bindownload.cgi
134134
135135** ant init**
136136
137- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-0d37a1be0ef4238a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
137+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-0d37a1be0ef4238a.png " /></div >
138138
139139在 D:\Temp\ant_test 路径下创建了一个 build 目录,执行成功。
140140
141141** ant compile**
142142
143- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-6f35ed13331c87c9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
143+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-6f35ed13331c87c9.png " /></div >
144144
145145提示错误,原来是在 build.xml 的所在目录下找不到 src 目录。好的,我们直接创建一个 src 目录,然后再次尝试。这次,执行成功。
146146
147- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-9e84af99a8e952e0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
147+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-9e84af99a8e952e0.png " /></div >
148148
149149** ant dist **
150150
151- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-daeaf201bf05e097.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
151+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-daeaf201bf05e097.png " /></div >
152152
153153在 D:\Temp\ant_test 路径下创建了一个 dist 目录,执行成功。
154154
155155** ant clean**
156156
157- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-be427613f7867513.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
157+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-be427613f7867513.png " /></div >
158158
159159清除创建的 build 和 dist 目录,执行成功。
160160
@@ -164,7 +164,7 @@ ant 的官方下载地址:http://ant.apache.org/bindownload.cgi
164164
165165请留意一下 build.xml 中的内容。有部分 ** target** 标签中含有 ** depends** 关键字。
166166
167- <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-746a2156fbfb8d54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 " /></div >
167+ <div align =" center " ><img src =" http://upload-images.jianshu.io/upload_images/3101171-746a2156fbfb8d54.png " /></div >
168168
169169这表明,当前的 target 在执行时需要依赖其他的 target,必须先执行依赖的 target,然后再执行。
170170
0 commit comments