1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <project basedir="." default="jar.client"> |
---|
3 | <!--Auto generated ant build file--> |
---|
4 | <property environment="env"/> |
---|
5 | <property name="axis2.home" value="${env.AXIS2_HOME}"/> |
---|
6 | <property name="project.base.dir" value="."/> |
---|
7 | <property name="maven.class.path" value=""/> |
---|
8 | <property name="name" value="AttAuthorityService"/> |
---|
9 | <property name="src" value="${project.base.dir}/src"/> |
---|
10 | <property name="test" value="${project.base.dir}/test"/> |
---|
11 | <property name="build" value="${project.base.dir}/build"/> |
---|
12 | <property name="classes" value="${build}/classes"/> |
---|
13 | <property name="lib" value="${build}/lib"/> |
---|
14 | <property name="resources" value="${project.base.dir}/resources"/> |
---|
15 | <property value="" name="jars.ok"/> |
---|
16 | <path id="axis2.class.path"> |
---|
17 | <pathelement path="${java.class.path}"/> |
---|
18 | <pathelement path="${maven.class.path}"/> |
---|
19 | <fileset dir="${axis2.home}"> |
---|
20 | <include name="lib/*.jar"/> |
---|
21 | </fileset> |
---|
22 | </path> |
---|
23 | <target name="init"> |
---|
24 | <mkdir dir="${build}"/> |
---|
25 | <mkdir dir="${classes}"/> |
---|
26 | <mkdir dir="${lib}"/> |
---|
27 | </target> |
---|
28 | <target depends="init" name="pre.compile.test"> |
---|
29 | <!--Test the classpath for the availability of necesary classes--> |
---|
30 | <available classpathref="axis2.class.path" property="stax.available" classname="javax.xml.stream.XMLStreamReader"/> |
---|
31 | <available classpathref="axis2.class.path" property="axis2.available" classname="org.apache.axis2.engine.AxisEngine"/> |
---|
32 | <condition property="jars.ok"> |
---|
33 | <and> |
---|
34 | <isset property="stax.available"/> |
---|
35 | <isset property="axis2.available"/> |
---|
36 | </and> |
---|
37 | </condition> |
---|
38 | <!--Print out the availabilities--> |
---|
39 | <echo message="Stax Availability= ${stax.available}"/> |
---|
40 | <echo message="Axis2 Availability= ${axis2.available}"/> |
---|
41 | </target> |
---|
42 | <target depends="pre.compile.test" name="compile.src" if="jars.ok"> |
---|
43 | <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true" destdir="${classes}" srcdir="${src}"> |
---|
44 | <classpath refid="axis2.class.path"/> |
---|
45 | </javac> |
---|
46 | </target> |
---|
47 | <target depends="compile.src" name="compile.test" if="jars.ok"> |
---|
48 | <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true" destdir="${classes}"> |
---|
49 | <src path="${test}"/> |
---|
50 | <classpath refid="axis2.class.path"/> |
---|
51 | </javac> |
---|
52 | </target> |
---|
53 | <target depends="pre.compile.test" name="echo.classpath.problem" unless="jars.ok"> |
---|
54 | <echo message="The class path is not set right! Please make sure the following classes are in the classpath 1. XmlBeans 2. Stax 3. Axis2 "/> |
---|
55 | </target> |
---|
56 | <target depends="jar.server, jar.client" name="jar.all"/> |
---|
57 | <target depends="compile.src,echo.classpath.problem" name="jar.server" if="jars.ok"> |
---|
58 | <copy toDir="${classes}/META-INF" failonerror="false"> |
---|
59 | <fileset dir="${resources}"> |
---|
60 | <include name="*.xml"/> |
---|
61 | <include name="*.wsdl"/> |
---|
62 | <include name="*.xsd"/> |
---|
63 | </fileset> |
---|
64 | </copy> |
---|
65 | <jar destfile="${lib}/${name}.aar"> |
---|
66 | <fileset excludes="**/Test.class" dir="${classes}"/> |
---|
67 | </jar> |
---|
68 | </target> |
---|
69 | <target if="jars.ok" name="jar.client" depends="compile.src"> |
---|
70 | <jar destfile="${lib}/${name}-test-client.jar"> |
---|
71 | <fileset dir="${classes}"> |
---|
72 | <exclude name="**/META-INF/*.*"/> |
---|
73 | <exclude name="**/lib/*.*"/> |
---|
74 | <exclude name="**/*MessageReceiver.class"/> |
---|
75 | <exclude name="**/*Skeleton.class"/> |
---|
76 | </fileset> |
---|
77 | </jar> |
---|
78 | </target> |
---|
79 | <target if="jars.ok" depends="jar.server" name="make.repo"> |
---|
80 | <mkdir dir="${build}/repo/"/> |
---|
81 | <mkdir dir="${build}/repo/services"/> |
---|
82 | <copy file="${build}/lib/${name}.aar" toDir="${build}/repo/services/"/> |
---|
83 | </target> |
---|
84 | <target if="jars.ok" depends="make.repo" name="start.server"> |
---|
85 | <java fork="true" classname="org.apache.axis2.transport.http.SimpleHTTPServer"> |
---|
86 | <arg value="${build}/repo"/> |
---|
87 | <classpath refid="axis2.class.path"/> |
---|
88 | </java> |
---|
89 | </target> |
---|
90 | <target if="jars.ok" depends="compile.test" name="run.test"> |
---|
91 | <path id="test.class.path"> |
---|
92 | <pathelement location="${lib}/${name}-test-client.jar"/> |
---|
93 | <path refid="axis2.class.path"/> |
---|
94 | <pathelement location="${classes}"/> |
---|
95 | </path> |
---|
96 | <mkdir dir="${build}/test-reports/"/> |
---|
97 | <junit haltonfailure="yes" printsummary="yes"> |
---|
98 | <classpath refid="test.class.path"/> |
---|
99 | <formatter type="plain"/> |
---|
100 | <batchtest fork="yes" toDir="${build}/test-reports/"> |
---|
101 | <fileset dir="${test}"> |
---|
102 | <include name="**/*Test*.java"/> |
---|
103 | </fileset> |
---|
104 | </batchtest> |
---|
105 | </junit> |
---|
106 | </target> |
---|
107 | <target name="clean"> |
---|
108 | <delete dir="${build}"/> |
---|
109 | </target> |
---|
110 | </project> |
---|