| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
/**************************************************** |
|---|
| 4 |
** Edit For Each Project |
|---|
| 5 |
** |
|---|
| 6 |
** You should expect to have to edit the following |
|---|
| 7 |
** section for each project. |
|---|
| 8 |
****************************************************/ |
|---|
| 9 |
--> |
|---|
| 10 |
|
|---|
| 11 |
<!--Project. Configuration that affects the project as a whole, project name etc.--> |
|---|
| 12 |
|
|---|
| 13 |
<project basedir="." default="jar" name="com.qwirx.lex"> |
|---|
| 14 |
|
|---|
| 15 |
<property name="package" value="com.qwirx"/> |
|---|
| 16 |
|
|---|
| 17 |
<!--Compile. Location of source files, destination of compiled files, files to include in compilation etc.--> |
|---|
| 18 |
<property name="build.directory" value="tmp"/> |
|---|
| 19 |
<property name="source.directory" value="src"/> |
|---|
| 20 |
<property name="test.source.directory" value="test"/> |
|---|
| 21 |
<property name="lib.directory" value="jsp/WEB-INF/lib/"/> |
|---|
| 22 |
<property name="build.compiler" value="modern"/> |
|---|
| 23 |
<!--Allow shell environment variables to be called with the "env." prefix --> |
|---|
| 24 |
<property environment="env"/> |
|---|
| 25 |
|
|---|
| 26 |
<path id="classpath"> |
|---|
| 27 |
<fileset dir="${lib.directory}"> |
|---|
| 28 |
<include name="**/*.jar"/> |
|---|
| 29 |
</fileset> |
|---|
| 30 |
</path> |
|---|
| 31 |
|
|---|
| 32 |
<!--Distribution. Where the distributable results of the build are placed.--> |
|---|
| 33 |
<property name="distribution.directory" value="dist"/> |
|---|
| 34 |
|
|---|
| 35 |
<!--Jar. Name of the jar file produced by the build process --> |
|---|
| 36 |
<!--name and location of the jar file to build--> |
|---|
| 37 |
<property name="jar.directory" value="${distribution.directory}"/> |
|---|
| 38 |
<property name="jar.name" value="com.qwirx.db.jar"/> |
|---|
| 39 |
<property name="jar.basedirectory" value="${build.directory}"/> |
|---|
| 40 |
|
|---|
| 41 |
<!--exclude all unit test files from the jar file--> |
|---|
| 42 |
<!-- <property name="jar.excludes" value="**/test/**"/> --> |
|---|
| 43 |
|
|---|
| 44 |
<!--Resources. The location of other resources other than source code--> |
|---|
| 45 |
<property name="jsp.directory" value="jsp"/> |
|---|
| 46 |
|
|---|
| 47 |
<!--These are to put in the released Jar's manifest. --> |
|---|
| 48 |
<property name="release.version" value="${RELEASE_VERSION}"/> |
|---|
| 49 |
|
|---|
| 50 |
<!-- |
|---|
| 51 |
/**************************************************** |
|---|
| 52 |
** Restricted Edit |
|---|
| 53 |
** |
|---|
| 54 |
** You shouldn't have to edit anything below. |
|---|
| 55 |
****************************************************/ --> |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
<!-- |
|---|
| 60 |
/***************************************************** |
|---|
| 61 |
** Initialise |
|---|
| 62 |
******************************************************/--> |
|---|
| 63 |
<target name="init"> |
|---|
| 64 |
<tstamp/> |
|---|
| 65 |
</target> |
|---|
| 66 |
|
|---|
| 67 |
<!-- |
|---|
| 68 |
/***************************************************** |
|---|
| 69 |
** Compile: Delete the build directory, recreate it and compile all the source code |
|---|
| 70 |
******************************************************/--> |
|---|
| 71 |
<target name="compile" depends="init" unless="build.compiled"> |
|---|
| 72 |
<delete dir="${build.directory}"/> |
|---|
| 73 |
<mkdir dir="${build.directory}"/> |
|---|
| 74 |
<javac classpathref="classpath" |
|---|
| 75 |
srcdir="${source.directory}/com/qwirx/db" |
|---|
| 76 |
destdir="${build.directory}" |
|---|
| 77 |
source="1.5" target="1.5" debug="yes" /> |
|---|
| 78 |
<copy todir="${build.directory}"> |
|---|
| 79 |
<fileset dir="${source.directory}"> |
|---|
| 80 |
<include name="**/*.xsl"/> |
|---|
| 81 |
<include name="**/*.html"/> |
|---|
| 82 |
<include name="**/*.js"/> |
|---|
| 83 |
</fileset> |
|---|
| 84 |
</copy> |
|---|
| 85 |
<property name="build.compiled" value="true"/> |
|---|
| 86 |
</target> |
|---|
| 87 |
|
|---|
| 88 |
<target name="javac"> |
|---|
| 89 |
<javac debug="on" optimize="off" |
|---|
| 90 |
destdir="${build.directory}" |
|---|
| 91 |
includes="com/qwirx/db/**/*.java"> |
|---|
| 92 |
<src path="${source.directory}" /> |
|---|
| 93 |
<classpath refid="classpath"/> |
|---|
| 94 |
</javac> |
|---|
| 95 |
</target> |
|---|
| 96 |
|
|---|
| 97 |
<!-- |
|---|
| 98 |
/***************************************************** |
|---|
| 99 |
** Compile Tests: Compile all the source code in test dir |
|---|
| 100 |
******************************************************/--> |
|---|
| 101 |
<target name="compile-tests" depends="compile"> |
|---|
| 102 |
<javac deprecation="on" debug="on" optimize="off" destdir="${build.directory}" srcdir="${test.source.directory}"> |
|---|
| 103 |
<classpath refid="classpath"/> |
|---|
| 104 |
</javac> |
|---|
| 105 |
<copy todir="${build.directory}"> |
|---|
| 106 |
<fileset dir="${test.source.directory}"> |
|---|
| 107 |
<include name="*.properties"/> |
|---|
| 108 |
<include name="**/*.properties"/> |
|---|
| 109 |
</fileset> |
|---|
| 110 |
</copy> |
|---|
| 111 |
</target> |
|---|
| 112 |
|
|---|
| 113 |
<!-- |
|---|
| 114 |
/***************************************************** |
|---|
| 115 |
** Compile Tests: Compile all the source code in test dir |
|---|
| 116 |
** Assume that compile has already happened, to save us |
|---|
| 117 |
** compiling the main stuff twice. But have check aswell |
|---|
| 118 |
******************************************************/--> |
|---|
| 119 |
<target name="compile-tests-after-war"> |
|---|
| 120 |
<fail message="Compile has not happened" unless="build.compiled"/> |
|---|
| 121 |
<javac deprecation="on" debug="on" optimize="off" destdir="${build.directory}" srcdir="${test.source.directory}"> |
|---|
| 122 |
<classpath refid="classpath"/> |
|---|
| 123 |
</javac> |
|---|
| 124 |
<copy todir="${build.directory}"> |
|---|
| 125 |
<fileset dir="${test.source.directory}"> |
|---|
| 126 |
<include name="*.properties"/> |
|---|
| 127 |
<include name="**/*.properties"/> |
|---|
| 128 |
</fileset> |
|---|
| 129 |
</copy> |
|---|
| 130 |
</target> |
|---|
| 131 |
|
|---|
| 132 |
<!-- |
|---|
| 133 |
/***************************************************** |
|---|
| 134 |
** Build Jar file |
|---|
| 135 |
******************************************************/ |
|---|
| 136 |
--> |
|---|
| 137 |
<target name="jar" depends="compile"> |
|---|
| 138 |
<mkdir dir="${jar.directory}"/> |
|---|
| 139 |
<jar jarfile="${jar.directory}/${jar.name}" basedir="${jar.basedirectory}"> |
|---|
| 140 |
<manifest> |
|---|
| 141 |
<section name="org/aidworld"> |
|---|
| 142 |
<attribute name="Implementation-Title" value="loband"/> |
|---|
| 143 |
<attribute name="Implementation-Version" value="${release.version}, ${TODAY}"/> |
|---|
| 144 |
<attribute name="Implementation-Vendor" value="aidworld"/> |
|---|
| 145 |
</section> |
|---|
| 146 |
</manifest> |
|---|
| 147 |
</jar> |
|---|
| 148 |
</target> |
|---|
| 149 |
|
|---|
| 150 |
<!-- |
|---|
| 151 |
/***************************************************** |
|---|
| 152 |
** Build .War file |
|---|
| 153 |
******************************************************/--> |
|---|
| 154 |
<target name="war" depends="jar"> |
|---|
| 155 |
<mkdir dir="${war.directory}"/> |
|---|
| 156 |
<war warfile="${war.directory}/${war.filename}" webxml="${war.webxml}"> |
|---|
| 157 |
<classes dir="${build.directory}"> |
|---|
| 158 |
<include name="*.*"/> |
|---|
| 159 |
<exclude name="web.xml"/> |
|---|
| 160 |
</classes> |
|---|
| 161 |
<classes dir="${properties.directory}"> |
|---|
| 162 |
<include name="*.properties"/> |
|---|
| 163 |
</classes> |
|---|
| 164 |
<lib dir="${lib.directory}"> |
|---|
| 165 |
<include name="*.jar"/> |
|---|
| 166 |
<include name="*.zip"/> |
|---|
| 167 |
<exclude name="servlet.jar"/> |
|---|
| 168 |
<exclude name="xercesImpl.jar"/> |
|---|
| 169 |
</lib> |
|---|
| 170 |
<lib dir="${jar.directory}"> |
|---|
| 171 |
<include name="*.jar"/> |
|---|
| 172 |
</lib> |
|---|
| 173 |
<fileset dir="${jsp.directory}"> |
|---|
| 174 |
<exclude name="WEB-INF/web.xml"/> |
|---|
| 175 |
</fileset> |
|---|
| 176 |
</war> |
|---|
| 177 |
</target> |
|---|
| 178 |
</project> |
|---|