root / branches / multithread / bin / build.xml

Revision 28, 3.8 kB (checked in by max, 1 year ago)
Line 
1<project name="URV.PLANETSIM.MULTITHREAD" default="targets" basedir=".">
2
3        <property environment="env"/>
4        <property file="planetsim.properties"/>
5
6
7  <path id="base.path">
8      <pathelement path="${classpath}"/>
9      <fileset dir="../lib">
10        <include name="**/*.jar"/>
11      </fileset>
12   </path>
13
14
15    <target name="jar">
16        <delete dir="../out"/>
17        <mkdir dir="../out"/>
18        <delete file="../lib/planetsim.jar"/>
19       
20        <javac srcdir="../src"
21                   destdir="../out"
22                   source="1.5"
23                   target="1.5">
24                <classpath refid="base.path"/>     
25        </javac>     
26        <jar jarfile="../lib/planetsim.jar"
27                 basedir="../out" >
28            </jar>
29        </target>
30
31
32    <target name="jar_debug">
33        <delete dir="../out"/>
34        <mkdir dir="../out"/>
35        <delete file="../lib/planetsim.jar"/>
36       
37        <javac  srcdir="../src"
38                destdir="../out"
39                source="1.5"
40                target="1.5"
41                debug="yes"
42                debuglevel="lines,vars,source">
43                <classpath refid="base.path"/>
44        </javac>
45        <jar jarfile="../lib/planetsim.jar" basedir="../out"></jar>
46    </target>
47
48 
49    <target name="api"> 
50          <delete dir="../docs/api"/>
51          <javadoc destdir="../docs/api"
52           author="true"
53           version="true"
54           use="true"
55           windowtitle="PlanetSim">
56                <fileset dir="../src">
57              <include name="planet/**" />
58              <exclude name="**/*.lst" />
59            </fileset>
60                        <classpath refid="base.path"/>
61          </javadoc>
62        </target>
63
64 
65        <target name="run1" description="planet.test.helloworld.DHTPeerTest">
66                <echo message="running planet.test.helloworld.DHTPeerTest..."/>
67                <java classname="planet.test.helloworld.DHTPeerTest">
68                         <jvmarg value="-Xms512M"/>
69                         <jvmarg value="-Xmx1024M"/>
70                <classpath refid="base.path"/>   
71                </java>
72        </target>
73       
74        <target name="run2" description="planet.test.trivialp2ptest.TrivialTest">
75                <echo message="running planet.test.trivialp2ptest.TrivialTest..."/>
76                        <java classname="planet.test.trivialp2ptest.TrivialTest">
77                                 <jvmarg value="-Xms512M"/>
78                                 <jvmarg value="-Xmx1024M"/>
79                        <classpath refid="base.path"/>   
80                        </java>
81                </target>
82       <target name="test">
83           <mkdir dir="reports"/>
84           <junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no">
85           <formatter type="xml" />
86           <test name="planet.test.SimpleTest" todir="./reports"/>
87           <classpath>
88             <path refid="base.path" />
89             <pathelement path="../lib/planetsim.jar" />
90             <pathelement path="../lib/junit.jar" />
91           </classpath>
92           </junit>
93   
94           <junitreport todir="./reports">
95             <fileset dir="./reports">
96               <include name="TEST-*.xml"/>
97             </fileset>
98             <report format="frames" todir="./reports"/>
99           </junitreport>
100        <echo>
101                See the results opening the file PLANETSIM/bin/reports/index.html
102        </echo>
103       </target>
104 
105 
106  <!-- =============================== Help =============================== -->
107  <target name="targets">
108    <echo message=""/>
109    <echo message="ANT build targets for P2P simulator"/>
110    <echo message=""/>
111    <echo message="The following targets are available:"/>
112    <echo message="  jar         Compile and create distribution, without debug options"/>
113    <echo message="  jar_debug   Compile and create distribution with activated debug options"/>
114    <echo message="  api         Generate api docs "/>
115    <echo message="  run1         Runs planet.test.helloworld.DHTPeerTest"/>
116         <echo message="  run2         Runs planet.test.trivialp2ptest.TrivialTest"/>
117    <echo message="  test        Execute a JUnit test. The output is in HTML format in 'reports' directory."/>
118  </target>
119
120</project>
Note: See TracBrowser for help on using the browser.