Cleaned up the ant build file, renamed final jar to collect-view.jar

This commit is contained in:
nifi 2010-11-12 16:48:32 +00:00
parent 5de83c9085
commit 42cc61dd91

View file

@ -6,31 +6,47 @@
<property name="lib" location="lib"/> <property name="lib" location="lib"/>
<property name="dist" location="dist"/> <property name="dist" location="dist"/>
<property name="contiki" location="../.."/> <property name="contiki" location="../.."/>
<property name="archive" value="collect-demo.jar"/> <property name="archive" value="collect-view.jar"/>
<property name="main" value="se.sics.contiki.collect.CollectServer"/> <property name="main" value="se.sics.contiki.collect.CollectServer"/>
<property name="args" value="" />
<path id="classpath">
<fileset dir="${lib}" includes="**/*.jar"/>
</path>
<manifestclasspath property="jar.classpath" jarfile="${archive}">
<classpath refid="classpath" />
</manifestclasspath>
<target name="init"> <target name="init">
<tstamp/> <tstamp/>
<mkdir dir="${build}"/> <mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target> </target>
<target name="compile" depends="init"> <target name="compile" depends="init">
<javac srcdir="${java}" destdir="${build}" debug="true" <javac srcdir="${java}" destdir="${build}" classpathref="classpath"
includeantruntime="false"> debug="true" includeantruntime="false" />
<classpath> </target>
<fileset dir="${lib}">
<include name="**/*.jar"/> <target name="jar" depends="compile">
</fileset> <jar destfile="${dist}/${archive}" basedir="${build}">
</classpath> <manifest>
</javac> <attribute name="Main-Class" value="${main}"/>
<attribute name="Class-Path" value="${jar.classpath}" />
</manifest>
</jar>
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="${lib}"/>
</copy>
</target> </target>
<condition property="sky-shell.exists"> <condition property="sky-shell.exists">
<available file="${dist}/sky-shell.ihex"/> <available file="${dist}/sky-shell.ihex"/>
</condition> </condition>
<target name="sky-shell.ihex" unless="sky-shell.exists"> <target name="sky-shell.ihex" unless="sky-shell.exists" depends="init">
<mkdir dir="${dist}"/>
<exec dir="${contiki}/examples/sky-shell" executable="make"> <exec dir="${contiki}/examples/sky-shell" executable="make">
<arg value="TARGET=sky"/> <arg value="TARGET=sky"/>
<arg value="sky-shell.ihex"/> <arg value="sky-shell.ihex"/>
@ -38,21 +54,8 @@
<copy todir="${dist}" file="${contiki}/examples/sky-shell/sky-shell.ihex"/> <copy todir="${dist}" file="${contiki}/examples/sky-shell/sky-shell.ihex"/>
</target> </target>
<target name="dist" depends="compile,sky-shell.ihex"> <target name="dist" depends="jar,sky-shell.ihex">
<mkdir dir="${dist}"/>
<jar destfile="${dist}/${archive}" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="${main}"/>
<attribute name="Class-Path" value="lib/jcommon-1.0.13.jar lib/jfreechart-1.0.10.jar"/>
</manifest>
</jar>
<copy todir="${dist}" file="collect-init.script"/> <copy todir="${dist}" file="collect-init.script"/>
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</copy>
<mkdir dir="${dist}/tools"/> <mkdir dir="${dist}/tools"/>
<copy todir="${dist}/tools"> <copy todir="${dist}/tools">
<fileset dir="${contiki}/tools/sky"/> <fileset dir="${contiki}/tools/sky"/>
@ -62,7 +65,9 @@
</target> </target>
<target name="run" depends="dist"> <target name="run" depends="dist">
<java fork="yes" dir="${dist}" jar="${dist}/${archive}"/> <java fork="yes" dir="${dist}" jar="${dist}/${archive}">
<arg line="${args}"/>
</java>
</target> </target>
<target name="clean"> <target name="clean">