<?xml version="1.0"?>
<!-- Written to assume that classpath is rooted in the current directory. -->
<!-- So this should be OK if you make this script in the root of a filesystem. -->
<!-- If not, you may prefer to adjust the basedir, or move some directories around. -->
<!-- The idea is that both Ant and NetBeans have to know what the package root is -->
<!-- for the classes in your application. -->
<project name="NobleTools" basedir="." default="all">
<!-- Don't worry if you don't know the Ant syntax completely or need help on some tasks! -->
<!-- The standard Ant documentation is bundled. See Help | Shortcuts | Ant 1.3 Documentation. -->
<property environment="env" />
<property name="manifest.app.name" value="NobleCoder" />
<property name="manifest.created.by" value="University of Pittsburgh" />
<property name="manifest.main.class" value=" edu.pitt.dbmi.nlp.noble.ui.NobleCoderTool" />
<property name="version.number" value="1.0" />
<!-- directories -->
<property name="lib.dir" value="lib" />
<property name="src.dir" value="src" />
<property name="bin.dir" value="bin" />
<property name="resource.dir" value="src/resources" />
<property name="icon.dir" value="src/icons" />
<property name="doc.dir" value="doc" />
<!-- buildc dir sits OUTSIDE the cvs -->
<property name="build.dir" value="./build" />
<property name="build.classes" value="${build.dir}/classes" />
<!-- 3rd party libraries -->
<property name="servlet" value="servlet-2_3.jar" />
<property name="owl" value="owlapi-distribution-3.5.0.jar" />
<property name="jdbm3" value="jdbm-3.0.jar" />
<property name="protege" value="protege.jar" />
<property name="protege-owl" value="protege-owl.jar" />
<!-- libs for this projects -->
<property name="library.file" value="${build.dir}/NobleTools-${version.number}.jar" />
<property name="package.file" value="${build.dir}/NobleCoder.jar" />
<!-- CLASSPATH definitions -->
<path id="class.path">
<pathelement location="${lib.dir}/${jdbm3}" />
<pathelement location="${lib.dir}/${owl}" />
</path>
<!-- targets -->
<!-- Utility Targets -->
<target name="clean" depends="">
<delete dir="${build.classes}" />
<delete dir="${build.lib}" />
<delete dir="${build.sign}" />
</target>
<target name="all" depends="" description="Build, Move everything.">
<echo message="Application built. No Problems!" />
</target>
<!-- create build directories???? (I don't know if it is necessary thought) -->
<target name="makedirs" depends="">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes}" />
<mkdir dir="${build.classes}/icons" />
<mkdir dir="${build.classes}/resources" />
</target>
<!-- compile client code -->
<target name="compile" depends="clean,makedirs">
<javac srcdir="${src.dir}" destdir="${build.classes}" debug="true" deprecation="true" classpathref="class.path" source="1.5" target="1.5">
<exclude name="**/protege/**" />
<exclude name="**/servlet/**" />
</javac>
</target>
<target name="jar" depends="compile" description="create a NobleTools.jar library to use for API calls">
<copy todir="${build.classes}/resources">
<fileset dir="${resource.dir}" includes="*.*" />
</copy>
<copy todir="${build.classes}/icons">
<fileset dir="${icon.dir}" includes="*.gif" />
</copy>
<jar jarfile="${library.file}" basedir="${build.classes}">
<manifest>
<attribute name="Trusted-Library" value="true" />
</manifest>
</jar>
</target>
<target name="exec_NobleCoder" description="build stand-alone NobleCoder.jar application">
<echo>=== PACKAGE ===</echo>
<!-- convert build.classpath to mf.classpath (the string needed for the manifest task) -->
<pathconvert property="mf.classpath" pathsep=" ">
<path refid="class.path" />
<flattenmapper />
</pathconvert>
<!-- now build the manifest file, using mf.classpath -->
<tstamp />
<!-- needed for TODAY -->
<!-- create the jar file, including the manifest file we just created -->
<jar destfile="${package.file}" filesetmanifest="mergewithoutmain">
<zipgroupfileset dir="${lib.dir}">
<exclude name="servlet*" />
<exclude name="protege*" />
<exclude name="jena*" />
<include name="*.jar" />
</zipgroupfileset>
<fileset dir="${bin.dir}"/>
<manifest>
<attribute name="Application-Name" value="${manifest.app.name}" />
<attribute name="Created-By" value="${manifest.created.by}" />
<attribute name="Main-Class" value="${manifest.main.class}" />
<attribute name="Implementation-Version" value="${version.number}" />
<attribute name="Built-Date" value="${TODAY}" />
<attribute name="Class-Path" value="${mf.classpath}" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="*" />
</manifest>
</jar>
</target>
<target name="exec_InformationExtractor" description="build stand-alone NobleCoder.jar application">
<echo>=== PACKAGE ===</echo>
<!-- convert build.classpath to mf.classpath (the string needed for the manifest task) -->
<pathconvert property="mf.classpath" pathsep=" ">
<path refid="class.path" />
<flattenmapper />
</pathconvert>
<!-- now build the manifest file, using mf.classpath -->
<tstamp />
<!-- needed for TODAY -->
<!-- create the jar file, including the manifest file we just created -->
<jar destfile="${build.dir}/InformationExtractor.jar" filesetmanifest="mergewithoutmain">
<zipgroupfileset dir="${lib.dir}">
<exclude name="servlet*" />
<exclude name="protege*" />
<exclude name="jena*" />
<include name="*.jar" />
</zipgroupfileset>
<fileset dir="${bin.dir}"/>
<manifest>
<attribute name="Application-Name" value="InformationExtractor" />
<attribute name="Created-By" value="${manifest.created.by}" />
<attribute name="Main-Class" value="edu.pitt.dbmi.nlp.noble.extract.InformationExtractor" />
<attribute name="Implementation-Version" value="${version.number}" />
<attribute name="Built-Date" value="${TODAY}" />
<attribute name="Class-Path" value="${mf.classpath}" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="*" />
</manifest>
</jar>
</target>
<target name="doc">
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}/api/" packagenames="edu.pitt.*" />
</target>
</project>