NAnt学习笔记(1) -- NAnt的配置文件结构和一个简单的NAnt例子

NAnt运行自动构建依据的是xml格式的.build文件。

一个完整的build文件由一个project和多个target组成。每个target有可以包含多个task。

下面是一个编译Hello World项目的NAnt配置文件:

   1 <?xml version="1.0"?>
 2      < project  name ="Hello World"  default ="build"  basedir ="." >
 3          < description >The Hello World of build files. </ description >
 4          < property  name ="debug"  value ="true"  overwrite ="false"   />
 5          < target  name ="clean"  description ="remove all generated files" >
 6              < delete  file ="HelloWorld.exe"  failonerror ="false"   />
 7              < delete  file ="HelloWorld.pdb"  failonerror ="false"   />
 8          </ target >
 9          < target  name ="build"  description ="compiles the source code" >
10              < csc  target ="exe"  output ="HelloWorld.exe"  debug ="${debug}" >
11                  < sources >
12                      < includes  name ="HelloWorld.cs"   />
13                  </ sources >
14              </ csc >
15          </ target >
16      </ project >
 
这个例子中有2个target, 第一个target是clean, 删除上次编译生成的文件,第二个是build, 生成新的文件。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值