source: gs3-extensions/testing/trunk/src/build.xml@ 32680

Last change on this file since 32680 was 32680, checked in by ak19, 2 years ago

Another jar file for assertj swing

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1<?xml version="1.0"?>
2<project name="Greenstone3 Testing Extension" default="build-util-jar" basedir=".">
3 <!-- get properties from the environment -->
4 <property environment="env"/>
5 <property name="compile.includeantruntime" value="false"/> <!-- to get rid of annoying 'ant' warning -->
6
7 <property name="gli.home" value="${env.GSDL3SRCHOME}/gli"/>
8
9 <target name="build-util-jar">
10 <mkdir dir="${basedir}/build"/>
11 <javac srcdir="${basedir}/src" destdir="${basedir}/build">
12 <classpath>
13 <fileset dir="${basedir}/lib/java">
14 <include name="*.jar"/>
15 </fileset>
16 </classpath>
17 <include name="org/greenstone/gsdl3/testing/*.java"/>
18 </javac>
19 <jar destfile="${basedir}/lib/java/GSTestingUtil.jar">
20 <fileset dir="${basedir}/build">
21 <include name="org/greenstone/gsdl3/testing/**"/>
22 </fileset>
23 <manifest>
24 <attribute name="Built-By" value="Greenstone" />
25 </manifest>
26 </jar>
27 </target>
28
29<!-- +++++++++++++ TUTORIAL TESTING TARGETS ++++++++++++++ -->
30<target name="needs-make-gli-jar">
31 <condition property="gli-jar-missing">
32 <not>
33 <available file="${gli.home}/GLI.jar"/>
34 </not>
35 </condition>
36
37 <fail if="gli-jar-missing" message="Run the makegli followed by makejar scripts in the gli folder before starting the Greenstone server."/>
38</target>
39
40<target name="needs-gs3-setup">
41 <!-- has the gs3-setup script been run?? -->
42 <condition property="gs3-setup-not-done">
43 <not>
44 <isset property="env.GSDL3HOME"/>
45 </not>
46 </condition>
47
48 <fail if="gs3-setup-not-done" message="Please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before starting the Greenstone server."/>
49
50 <echo>GLI HOME: ${gli.home}</echo>
51 </target>
52
53<target name="compile-tutorials-tests" depends="needs-gs3-setup, needs-make-gli-jar">
54
55 <mkdir dir="${basedir}/build"/>
56 <javac
57 srcdir="${basedir}/src"
58 destdir="${basedir}/build"
59 includeantruntime="${compile.includeantruntime}">
60 <classpath>
61 <fileset dir="${basedir}/lib/java">
62 <include name="*.jar"/>
63 </fileset>
64 <fileset dir="${gli.home}">
65 <include name="GLI.jar"/>
66 </fileset>
67 </classpath>
68 <include name="gstests/tutorials/*.java"/>
69 </javac>
70 <jar destfile="${basedir}/tutorial-tests.jar">
71 <fileset dir="${basedir}/build">
72 <include name="gstests/tutorials/**"/>
73 </fileset>
74 <manifest>
75 <attribute name="Built-By" value="greenstone" />
76 </manifest>
77 </jar>
78</target>
79
80<!-- https://stackoverflow.com/questions/10704324/how-to-add-to-classpath-all-classes-from-set-of-directories-in-ant -->
81<path id="tutorials.path">
82 <fileset dir="${basedir}/lib/java">
83 <include name="*.jar"/>
84 </fileset>
85 <!--<fileset dir="${basedir}/build">
86 <include name="gstests/tutorials/**/*.class"/>
87 </fileset>-->
88 <files includes="${basedir}/tutorial-tests.jar"/>
89
90 <!-- To run GLI, need GLI.jar and its help jars and folder: classes folder, apache.jar, jna.jar, jna-platform.jar, qfslib.jar, rsyntaxtextarea.jar -->
91 <fileset dir="${gli.home}">
92 <include name="GLI.jar"/>
93 </fileset>
94 <pathelement path="${gli.home}/classes"/>
95 <fileset dir="${gli.home}/lib">
96 <include name="*.jar"/>
97 </fileset>
98</path>
99
100<!-- TODO: for darwin, need to set custom_vm_args, see gli.sh
101TODO: Launching GLI for GS2 is also different -->
102
103<!-- http://ant.1045680.n5.nabble.com/How-to-increase-memory-used-by-JVM-in-Ant-td1355370.html -->
104<target name="run-tutorials-tests" depends="needs-gs3-setup, needs-make-gli-jar">
105 <echo>Tutorial tests</echo>
106 <echo>GSDLHOME: ${env.GSDLHOME}</echo>
107 <java classname="org.junit.runner.JUnitCore" dir="${gli.home}" fork="true" maxmemory="256m" classpathref="tutorials.path">
108 <arg value="gstests.tutorials.RunGLITest"/>
109
110 </java>
111
112
113</target>
114
115</project>
116
Note: See TracBrowser for help on using the repository browser.