-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathjspc.xml
75 lines (63 loc) · 3.03 KB
/
jspc.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0"?>
<project default="jspc">
<!--
Note that this should be a self contained ant xml script that compiles
jsp's assuming a maven build structure and out put.
REQUIRES:
This build script requires that the normal build be run and
the expectation is that target/oscar.war was built and exists.
This script requires the environment variable CATALINA_HOME to be set,
this was tested against tomcat 6.0.18 and requires a version that
has the jasper compiler in it (5.0 versions did not).
-->
<property environment="env" />
<property name="catalina.home" location="${env.CATALINA_HOME}" />
<echo message="Using CATALINA_HOME=${catalina.home}" />
<import file="${catalina.home}/bin/catalina-tasks.xml" />
<property name="jspc.expandedWarDir" value="target/${jspc_target}" />
<property name="jspc.generatedDir" value="target/generated_jsp_classes" />
<target name="jspc" depends="jspc.clean">
<!--
The general algorithm is as follows :
1) compile jsp's into java source
2) compile java source into class files
-->
<mkdir dir="target/generated_jsp_classes"/>
<condition property="tomcat.lib" value="${catalina.home}/lib">
<available file="${catalina.home}/lib" type="dir" />
</condition>
<condition property="tomcat.lib" value="${catalina.home}/common/lib">
<available file="${catalina.home}/common/lib" type="dir" />
</condition>
<property name="tomcat.lib.dir" location="${tomcat.lib}" />
<!-- ant-contrib needed for the if statements -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="utils/tasks/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- tomcat 5.5 uses jasper2 where as tomcat 6 uses jasper -->
<if>
<equals arg1="${tomcat.lib.dir}" arg2="${catalina.home}/lib" />
<then>
<jasper uriroot="${jspc.expandedWarDir}" webXmlFragment="${jspc.generatedDir}/generated_web.xml" outputDir="${jspc.generatedDir}" failOnError="true" verbose="0" />
</then>
<else>
<jasper2 uriroot="${jspc.expandedWarDir}" webXmlFragment="${jspc.generatedDir}/generated_web.xml" outputDir="${jspc.generatedDir}" validateXml="false" failOnError="true" />
</else>
</if>
<javac srcdir="${jspc.generatedDir}" source="7" target="7" debug="on" memoryInitialSize="128m" compiler="modern" includeantruntime="false" memoryMaximumSize="1024m" fork="yes" encoding="UTF8">
<classpath>
<pathelement location="${jspc.expandedWarDir}/WEB-INF/classes" />
<pathelement path="${jspc.expandedWarDir}/WEB-INF/lib/*" />
<pathelement path="${tomcat.lib.dir}/*" />
<pathelement path="${catalina.home}/bin/*" />
</classpath>
<!-- we will allow this exclusion because this is not our code and is just included code from another library, this will allow upgrades to be easier if we don't change other people's library code. -->
<exclude name="org/apache/jsp/jspspellcheck/**" />
</javac>
</target>
<target name="jspc.clean">
<delete dir="${jspc.generatedDir}" quiet="true" />
</target>
</project>