vivo/legacy/utilities/pre-compileJSPs/jsp-build.xml

92 lines
3.1 KiB
XML
Raw Normal View History

2011-04-22 15:59:20 +00:00
<?xml version="1.0"?>
2016-11-02 22:29:59 -06:00
<!-- $This file is distributed under the terms of the license in LICENSE$ -->
2011-04-22 15:59:20 +00:00
<!-- ======================================================================
Compile the JSPs to check for compile errors.
As this stands, you need to be sure that the "war" or "deploy" step in the
main build has already happened. There is no check here to ensure that the
".build/war" directory is current.
====================================================================== -->
<project name="Check JSPs for compile errors" default="all" basedir="../..">
<!-- Get tomcat.home and webapp.name from the build.properties file. -->
<property name="build.properties.file" location="build.properties" />
<fail message="You must create a &quot;${build.properties.file}&quot; file.">
<condition>
<not>
<available file="${build.properties.file}" />
</not>
</condition>
</fail>
<property file="${build.properties.file}" />
<fail unless="tomcat.home"
message="${build.properties.file} must contain a value for tomcat.home" />
<fail unless="webapp.name"
message="${build.properties.file} must contain a value for webapp.name" />
<property name="build.jsp.dir" location=".build/jsp" />
<property name="build.webapp.dir" location=".build/main/webapp" />
<!-- Where are the Tomcat classes? -->
<path id="jasper.classpath">
<fileset dir="${tomcat.home}/bin">
<include name="*.jar" />
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="*.jar" />
</fileset>
</path>
<!-- Add in the project classes -->
<path id="compile.classpath">
<path refid="jasper.classpath" />
<pathelement location="${build.webapp.dir}/WEB-INF/classes" />
<fileset dir="${build.webapp.dir}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
</path>
<!-- Define the Jasper task -->
<taskdef classname="org.apache.jasper.JspC" name="jasper2">
<classpath refid="jasper.classpath" />
</taskdef>
<target name="clean"
description="Delete all build artifacts, so the next build starts from a clean slate">
<delete dir="${build.jsp.dir}" />
</target>
<target name="prepare">
<mkdir dir="${build.jsp.dir}" />
<mkdir dir="${build.jsp.dir}/src" />
<mkdir dir="${build.jsp.dir}/classes" />
</target>
<target name="jspc" depends="prepare">
<jasper2 uriroot="${build.webapp.dir}"
webXmlFragment="${build.jsp.dir}generated_web.xml"
outputDir="${build.jsp.dir}/src"
trimSpaces="true"
failOnError="true" />
</target>
<target name="compile" depends="jspc">
<javac destdir="${build.jsp.dir}/classes"
optimize="off"
debug="off"
failonerror="true"
2011-04-22 18:35:05 +00:00
includeantruntime="false"
srcdir="${build.jsp.dir}/src"
excludes="**/*.smap">
<classpath refid="compile.classpath" />
<include name="**" />
<exclude name="tags/**" />
</javac>
</target>
<target name="all"
depends="clean, compile"
description="Compile the JSPs to classfiles, just to check for compile errors." />
2016-11-02 22:29:59 -06:00
</project>