2009年6月24日水曜日

Ant用build.xmlの作成及び実行

Ant用build.xmlの作成及び実行:
※参照サイト:http://www.alles.or.jp/~torutk/oojava/maneuver/2001/ant/ant.html

1.サンプルプロジェクトの構成:
・Amazon SimpleDBのアンプルプロジェクト
※参照サイト:http://docs.amazonwebservices.com/AmazonSimpleDB/latest/GettingStartedGuide/
・ディレクトリ構成:
AntProject
  ¦-build.xml
  ¦-lib
¦-src
¦-com
  ¦-amazonaws
¦-sdb
  ¦-samples
¦-CreateDomainSample.java

2.build.xmlの構成要求:
・「.classファイル」のフォルダが自動に作成される
・「.jarファイル」のフォルダが自動に作成される
・コンパイルタスクができる
・実行タスクがる
・クリンタスクがある
※build.xmlを実行用のapache-antパッケージの用意が必要

3.build.xmlファイルの作成
※詳しくは、build.xmlのサンプルを参照

4.build.xmlによって、Antのコマンドを実行
①コマンドラインから、AntProjectフォルダへ移動
>cd /AntProject
②コンパイルの実行
>C:\apache-ant-1.6.3\bin\ant.bat
または
>C:\apache-ant-1.6.3\bin\ant.bat dist
③jarファイルの実行
>C:\apache-ant-1.6.3\bin\ant.bat executeJar
④コンパイルより作成されたフォルダ及びファイルを削除
>C:\apache-ant-1.6.3\bin\ant.bat clean

0 件のコメント: