Ant入门

Ant入门

作者:陈跃峰

出自:http://blog.youkuaiyun.com/mailbomb

<o:p> </o:p>

       Ant(Another Neat Tool)是一个现在主流的构建(Build)工具,现在几乎所有的Java开源项目都使用它来编译自己的项目,而且主流的IDE对于Ant也提供了良好的支持。

       Ant完全使用Java语言进行开发,而且开放源代码,现在最新的版本是1.6.5,可以很方便的使用可扩展,使用Ant最主要的工作就是根据构建项目的需要编写对应的build.xml文件,使用该文件控制程序的编译、运行、打包等操作。

u       Ant的下载

       Ant是一个开源、免费的软件,可以从以下地址下载最新版本:

              http://ant.apache.org/<o:p></o:p>

u       Ant的安装和配置

       Ant的安装程序是一个压缩文件,例如最新版本的Ant 1.6.5安装程序文件名称为——apache-ant-1.6.5-bin.zip。

1.         Ant的安装

       Ant的安装很简单,解压缩即可。可以根据需要解压缩到任意目录。

2.         Ant的配置

       安装Ant完毕以后,为了更方便的使用,需要配置两个环境变量:

a)         path——把ant安装目录下的bin添加到path中。

b)        ant_home——Ant的安装目录,例如C:\ant\apache-ant-1.6.5。

这样就可以在命令行下面使用ant进行构建了。<o:p></o:p>

u       Ant的文档

       学习Ant的使用,可以认真阅读Ant的文档,我就是这样的学习的。Ant的使用手册可以从Ant安装目录下的docs\manual\index.html中进行阅读,这个是学习Ant使用,以及查找Ant标签的最好文档。<o:p></o:p>

u       build.xml文件基本格式

       Ant使用最核心的内容,就是编写build.xml文件,这是一个标准的xml文件,其基础结构为:

              <?xml version="1.0"?>

              <project>

                     <target>

                            ……

                     </target>

              </project>

       具体每个标签的作用以及其属性可以参考Ant文档。

u       一个简单的使用示例

       建立一个目录,例如D:\antTest,在该目录下建立如下文件和目录:

Ø         build.xml

Ø         src目录

l         该目录下包含Main.java

Ø         classes目录<o:p></o:p>

       这些文件的内容依次如下,首先看一下build.xml,其内容如下所示:

<?xml version="1.0"?>

<project name="Test Ant" default="Nokia S40 1.0" basedir=".">

       <description>build All version,include S40 1.0\S40 2.0\Moto,of this game</description><o:p></o:p>

       <target name="Nokia S40 1.0" description="build S40 1.0 classes">

              <javac

                     taskname="javac Nokia S40 1.0"

                     srcdir="${basedir}/src"

                     includes=""

                     destdir="${basedir}/classes/"

              />

              <java

                     taskname="java Nokia S40 1.0"

                     classname="test.Main"

                     classpath="${basedir}/classes"

              />

       </target>

</project>

Main.java的源代码如下所示:

package test;

public class <st1:place>Main</st1:place>{

       public static void main(String[] args){

              System.out.println("Test Ant");

       }

}

       创建好以上目录结构以后,就可以使用Ant来进行构建了,只需要在命令行中将当前目录切换到D:\antTest目录下,输入ant命令就可以执行了。

       当然这里只是实现了最简单的Ant功能,辅助大家快速熟悉Ant的使用,更多的内容以及使用可以阅读Ant提供的文档进行使用。<o:p></o:p>

Ant 入门 NULL 博文链接:https://teddywang.iteye.com/blog/722248 立即下载

相关推荐

ant入门教程

Apache Ant是一个基于Java的构建工具,它可以用于构建多种项目,但是目前主要被用于Java项目的构建, Ant是用Java语言编写,可以在多个操作系统中运行,目前在绝大部分的Java开源项目中,都选择使用Ant作为构建项目的工具,合理的使用Ant可以大大降低项目构建、部署的难度。在本课程的内容中,将介绍Ant构建项目的基本用法,利用这里基本的知识,我们可以尝试使用Ant来构建自己的项目,体验Ant给我们带来的方便和高效。

ant教程

ant 的详细的入门教程 Ant是一个Apache基金会下的跨平台的构件工具,它可以实现项目的自动构建和部署等功能。在本文中,主要让读者熟悉怎样将Ant应用到Java项目中,让它简化构建和部署操作。  一.             安装与配置 下载地址:http://ant.apache.org/,在本文中下载的是1.7.0版本。解压到某个目录(例如E:"apache-ant-1.7.0

zhaofuqiangmycomm的博客 561

Ant基本使用指南(入门教程)

在学习struts+spring+hibernate,尤其是Appfuse的过程中大量涉及到ant的使用,因此我觉得有必要对ant做个比较深入的学习,以下是在学习过程中搜集的材料。比较详细,很适合没有接触过ant的初学者。

Ant 基础入门篇

Ant配置的基本结构介绍及简单的使用示例

fanxiaobin 8834

【最全选型攻略-盘点篇】市面上有哪些靠谱的工业3D相机品牌?(双目、结构光、TOF、激光三角)

选工业3D相机,选最靠谱的品牌,选最Match你的产品,看这一篇就够了!

jiqishijueyingdi的博客 1万+

【清风数学建模笔记】第十一讲:时间序列分析

【清风数学建模笔记】第十一讲:时间序列分析

manerzi的博客 834

ANT 入门手册

一:基础语法 1.ant的编译文件默认为build.xml,一般无需改变。 2.build.xml的根节点为,一般格式如下: name为工程名称; default为默认的target,就是任务; basedir就是基路径。一般为&quot;.&quot; 3.property可以定义变量,一般格式如下: 引用的时候这么引用${test} ...

xiaoqiS的专栏 273

【原创】Ubuntu20.04 安装 Isaac Gym 仿真器

Ubuntu20.04 安装 Isaac Gym

qq_54900679的博客 3095

Ant参考教程

转载[url]http://www.javaresearch.org/article/66130.htm[/url] ant教程 1,什么是ant ant是构建工具 2,什么是构建 概念到处可查到,形象来说,你要把代码从某个地方拿来,编译,再拷贝到某个地方去等等操作,当然不仅与此,但是主要用来干这个 3,ant的好处 跨平台 --因为ant是使用java实现的,所以它跨平台 ...

liyanhui 1143

Discrete Optimization (Coursera) 学习笔记 Week 1 introduction (开个帖子)

Week 1 Introduction 这位教授Pascal Van Hentenryck 真的算是优化领域神级别的人物了吧?截一张Google scholar的图大家感受一下… 居然在Coursera上看到了他开的课:Discrete Optimization。试听了几节后,发现讲得很有激情,而且深入浅出。遂决定花暑假跟完这一门课。 这门课每周花两三个小时介绍基础概念,然后得花十几个小时写作业(coding)… 一开始以为Coursera上的课的作业应该不会太难,然后第一次作业(knapsack)我就被

ZJ_11701的博客 658

MuMu模拟器过检测实战:从硬件伪装到API欺骗的完整避坑指南

本文详细介绍了MuMu模拟器过检测的实战技术,从硬件伪装到API欺骗的全方位解决方案。通过修改CPU/GPU信息、内存分布、系统属性和行为模拟等关键技术,帮助用户有效绕过现代应用的模拟器检测机制,提升模拟器的隐蔽性和稳定性。

xxx12的博客 1410

Ant Design Pro入门

Ant Design Pro入门

qq_61313896的博客 3353

Dify搭建AI测试用例生成器

1、获取产品需求文档2、解读、分析、挖掘需求点,提炼为测试点3、依据测试点,生成详细的测试用例4、输出测试用例1、打开 Dify 控制台,依次点击【工作室】-【ChatFlow】-【创建空白应用】。

十二测试录 1372

ant的安装与入门理解

进公司一段时间了,感觉和其他同事相比自己掌握新知识的能力比较薄弱,无论是从掌握的速度和深度都感觉不如人家,哎,没办法,人比较蠢。 本文写的是ant的安装与入门,都是同事整理好给我们新手看的,比较基础,希望大家不要介意。(相关的文件可以在附件中找到) 1.ant 的安装           (1).下载ant压缩包,解压               (2).配置环境变量 :

小小菜鸟的博客 646

海康机器人visionmaster5.0全局通信西门子S7操作

德国西门子(SIEMENS)公司生产的可编程序控制器在我国的应用也相当广泛,在冶金、化工、印刷生产线等领域都有应用。西门子(SIEMENS)公司的PLC产品包括S7-200、S7-1200、S7-300、S7-400、S7-1500等。西门子S7系列PLC体积小、速度快、标准化,具有网络通信能力,功能更强,可靠性高。S7系列PLC产品可分为微型PLC(如S7-200),小规模性能要求的PLC(如S7-300)和中、高性能要求的PLC(如S7-400)等。

weixin_65316120的博客 425

汽车UDS诊断之诊断会话控制服务(0x10)深度剖析

DiagnosticSessionControl就是诊断会话控制。 请求消息定义 A_Data类型 参数名称 Cvt 字节值 助记符 #1 诊断会话控制请求SID M 0x10 DSC #2 子功能=[诊断会话类型] M 0x00-0xFF LEV_DS_ ...

心骗小白话的博客 7421

ant入门教材

ant入门教材 ant项目 ant必须build.xml

lujiebing的博客 200

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Ant入门教程

Ant入门教程

beingalong的专栏 144

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ant design pro模板_ant design pro超详细入门教程

1、Ant Design Pro 初了解说到ant design pro,得先了解一下ant design是个什么东西?ant design蚂蚁金服基于react打造的一个服务于企业级产品的UI框架。而ant design pro呢?就是基于Ant Design这个框架搭建的中后台管理控制台的脚手架 。2、安装默认你本地已安装好node和git环境$ git clone --depth=1 ht...

weixin_39669769的博客 3318

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Ant Design入门、Ant Design Pro入门

在config.js文件中进行配置: 小试牛刀 创建MyTabs.js文件: 在src目录下创建layouts目录,并且在layouts目录下创建index.js文件,写入内容: 需要特别说明的是,在umi中约定的目录结构中,layouts/index.js文件将被作为全 局的布局文件 接下来,配置路由:(非必须) config.js文件 首先,需要在布局文件中,将Content内容替换成{this.props.children},意思是引入传 递的内容。 接下来配置路由(注意,在布局路由下面进行配置) 说

王和平的第三个果园 906

快速学习Ant Design Pro-快速入门

3.2、快速入门 3.2.1、部署安装 下载地址:https://github.com/ant-design/ant-design-pro 我们使用资料中提供的,已经下载好的文件:ant-design-pro-master.zip 第一步:将ant-design-pro-master.zip解压到任意目录,我的目录是F:\code Ant Design Pro提供的目录如下: 第二步,导...

逍遥云恋 2022

ant入门程序

一. ant简介 Ant是apache的一个核心项目, 它的作用是项目自动化构建, 因为它内置了Javac、Java、创建目录、复制文件等功能,  直接运行build.xml文件就可以编译我们的项目。 二. ant配置 1. 新建环境变量ANT_HOME: ant的解压目录 2. 在path中配置:%ANT_HOME%/bin; 3.

技术人生 1010

ant design入门_Umi + ant Design Pro最简单的入门教程(一)初

前言umi,中文可发音为乌米,是一个可插拔的企业级 react 应用框架。这个库入门的门槛比较高,umi是这个样子的,umi = react + redux + react-router + ts + dva + umi脚手架 + ant Design Pro + ant Design UI + umi-block。如果你没有丰富的react基础你来学习他或者是看懂它,那将是很困难的一件事,本博客...

weixin_42202078的博客 2707
上一篇: CLDC API和MIDP API源代码下载地址(包含各个版本)
下一篇: 将限制转换为力量——设计一键(One-Button)游戏
java2000_test
博客等级 码龄19年 10粉丝 320原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值