Skip to content

Instantly share code, notes, and snippets.

@dhepper
Created July 25, 2011 13:29
Show Gist options
  • Save dhepper/1104113 to your computer and use it in GitHub Desktop.
Save dhepper/1104113 to your computer and use it in GitHub Desktop.
Ant file for WikipediaMiner
<project name="WikipediaMiner" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="test" location="test"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<path id="classpath">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classpath.test">
<fileset dir="${dist}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${test}" />
<path refid="classpath" />
</path>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="classpath" />
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/${ant.project.name}-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="compile-test">
<javac srcdir="${test}" includeantruntime="false">
<classpath refid="classpath.test" />
</javac>
</target>
<target name="build-db" depends="compile-test, dist">
<java classname="org.wikipedia.miner.db.WikipediaBuilder">
<arg value="${configPath}" />
<classpath refid="classpath.test" />
</java>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment