http://pcweb.mycom.co.jp/news/2005/07/12/016.html
Ant for eclipse - access eclipse configurations from within ant
http://ant4eclipse.sourceforge.net/
■必要なソフトウェア
JDK 1.4 or JDK5
ant 1.6
Ant-Contrib tasks
http://ant-contrib.sourceforge.net/
http://sourceforge.net/projects/ant-contrib
■インストール(Eclipse に)
Windows -> preferences のツリー Ant -> Runtime に以下を追加
Ant Home Entries ( C:/Program Files/apache-ant-1.6.5 )
C:/Program Files/apache-ant-1.6.5/lib/ant-contrib.jar
C:/Program Files/apache-ant-1.6.5/lib/ant4eclipse.jar
Global Entries
C:/Program Files/Java/jdk1.5.0_05/lib/tools.jar
■build ファイルの作成
<project name="com.example.xyz" default="build">
<!-- define ant4eclipse -->
<taskdef resource="net/sf/ant4eclipse/antlib.xml" />
<property name="workspace" value="${basedir}/.." />
<property name="project.name" value="com.example.xyz" />
<target name="build">
<!-- init -->
<delete dir="${workspace}/${project.name}/bin" />
<mkdir dir="${workspace}/${project.name}/bin" />
<!-- read the eclipse classpath -->
<getEclipseClasspath workspace="${workspace}" projectName="${project.name}" classpathId="build.classpath" />
<!-- compile -->
<javac srcdir="${workspace}/${project.name}/src" destdir="${workspace}/${project.name}/bin" classpathref="build.classpath" />
<!-- copy resources from src to bin -->
<copy todir="${workspace}/${project.name}/bin" preservelastmodified="true">
<fileset dir="${workspace}/${project.name}/src">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
</project>
0 件のコメント:
コメントを投稿