Build File Ant..

Setelah beberapa hari gue berkutat untuk membuat build.xml akhirnya gue berhasil juga😉

Di bawah ini contoh sederhana build file buat Ant.

<?xml version="1.0" encoding="UTF-8"?>
<project name="YansenLib" default="compile" basedir=".">
	<description>simple ant</description>
	
	<property name="src.dir"     value="src"/>
    <property name="build.dir"   value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="jar.dir"     value="${build.dir}/jar"/>
	
	<target name="init">
	   <tstamp/>
	   <mkdir dir="${build.dir}"/>
	</target>

    <target name="clean">
        <delete dir="build"/>
    </target>

    <target name="compile" depends="init">
        <mkdir dir="${classes.dir}"/>
        <javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="D:/data_yansen/Library/junit-4.5.jar"/>
    </target>

    <target name="jar" depends="compile">
        <mkdir dir="${jar.dir}"/>
        <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}"/>
    </target>

    <target name="run">
        <java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
    </target>
	
    <target name="clean-build" depends="clean,jar"/>

    <target name="main" depends="clean,run"/>
</project>

BTW sudah lama yah gue ga posting tentang pemrograman. Untuk selanjutnya gue akan memposting cara membuat struts – java framework.


One comment

  1. Bahasa paan tu cui..translate plizzz!!!😀
    ckckc..g idle aja bisa buat kayak gini..salutttt ^^
    sapa dulu..master portfolio pagenya SCBCN😀


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s