source: trunk/jsp-precompile.xml @ 7711

Last change on this file since 7711 was 7711, checked in by Nicklas Nordborg, 2 years ago

References #2139: Switch to Java 11 (or later)

Changed build script to specify Java 11. Biggest change is that the 'source' and 'target' parameters have merged to 'release' parameter and that 'bootclasspath' is no longer supported when compiling against java versions > 8.

File size: 2.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id$
4
5    This file is part of BASE - BioArray Software Environment.
6    Available at http://base.thep.lu.se/
7
8    BASE is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12
13    BASE is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with BASE. If not, see <http://www.gnu.org/licenses/>.
20-->
21<project
22  name="JspPrecompile"
23  default="all"
24  basedir="."
25  >
26 
27  <!--
28    Required parameters:
29    tomcat.home = path to Tomcat installation directory
30    jsp.src = path to directory containing JSP files to be compile
31    jsp.build = path to working directory where intermediate .java files and compiled .class files should be saved
32    javac.release = source and target version of java files
33  -->
34  <property name="javac.encoding" value="UTF-8" />
35  <!--
36    Use Xlint to detect potential problems:
37    -serial is needed since jasper doesn't generate a serialVersionUID
38  -->
39  <property name="jsp.xlint" value="all,-serial" />
40 
41  <import file="${tomcat.home}/bin/catalina-tasks.xml" />
42 
43  <!-- 'compile' JSP files to Java files -->
44  <target name="jspc">
45    <mkdir dir="${jsp.build}/java" /> <!-- output directory for *.java files -->
46    <echo>Using Tomcat in: ${tomcat.home}</echo>
47    <jasper
48      validateXml="false"
49      uriroot="${jsp.src}"
50      outputDir="${jsp.build}/java" 
51      webXmlFragment="${jsp.build}/generated_web.xml"
52      javaencoding="${javac.encoding}"
53      strictQuoteEscaping="false"
54    />
55  </target>
56 
57  <target name="compile">
58   
59    <path id="compile.classpath">
60      <pathelement location="${jsp.src}/WEB-INF/classes" />
61      <fileset dir="${jsp.src}/WEB-INF/lib">
62        <include name="*.jar" />
63      </fileset>
64      <pathelement location="${tomcat.home}/lib" />
65      <fileset dir="${tomcat.home}/lib">
66        <include name="*.jar"/>
67      </fileset>
68      <fileset dir="${tomcat.home}/bin">
69        <include name="*.jar"/>
70      </fileset>
71    </path>
72   
73    <mkdir dir="${jsp.build}/classes" /> <!-- output directory for *.class files -->
74    <echo>Using Xlint:${jsp.xlint}</echo>
75    <echo>Override this by setting 'jsp.xlint' in 'build.properties'</echo>
76    <javac
77      destdir="${jsp.build}/classes"
78      srcdir="${jsp.build}/java"
79      classpathref="compile.classpath"
80      fork="true"
81      debug="true"
82      includeantruntime="false"
83      release="${javac.release}"
84      encoding="${javac.encoding}"
85      >
86      <compilerarg value="-Xlint:${jsp.xlint}" />
87      <exclude name="org/apache/jsp/extensions/**" />
88    </javac>
89  </target>
90 
91  <target name="all" depends="jspc,compile" />
92</project>
Note: See TracBrowser for help on using the repository browser.