2010年6月19日 星期六

Ant

1. 說明:



2. 常用命令:
ant targetname<> in build.xml




3. 範例:
I. ant fw_app.build








4. 注意:
1. ant 會 build 整個 java 需要的檔案
2. 有時要會作 clear 動作

///////////////////
Ant 說明
////////////////////
使用 build.xml


/////////////////////////////////////////////
Ant tag
/////////////////////////////////////////////
1. (專案)
說明:
可以定義此 project 相關的設定值
屬性:
name: The ant project name
default: Default want to build target
basedir: You seting this project root path


2. (變數)
說明:
宣告 ant varaible, 在往後可以用 ${name} 取得變數
屬性:
name: Variable name
value: This varaible to value


3.
說明:
一個可以 build 或作其它操作指令的空間區
屬性:
name: 名稱
depends: 其它部份要先執行, 然後才能執行此 target 內容

4.
說明:
印出值在螢幕上

5.
屬性:
file: 要複製的來源檔
tofile: 目的地

6.
說明:
Ant support javac command
屬性:
srcdir: 要 compiler 資料夾
destdir: class 目地
includes: 預設是 compiler all, 但用 include 可以指定要 build file

7.
屬性:
verbose="true" : 是否印出刪除的檔案

8.
說明:
可包括許多檔案
屬性:
dir: set to the directory to file




//////////////////////////////////////////////////
Ant example
/////////////////////////////////////////////////
Simple build a project, compiler the src java to build directroy
to classs
{{{









Doing UKLights



Doing all






}}}


2.一個有 clean, 更多的 depends build, 從 build a file 到 build 更多 depends
{{{









Doing ExitControl





Doing AboutPopup



description="Builds AboutControl">
Doing AboutControl





description="Builds the main UKLights project">
Doing UKLights








Doing all













}}}

沒有留言:

張貼留言