diff -Nur freemarker-2.3.13/build.xml freemarker-2.3.13.new/build.xml --- freemarker-2.3.13/build.xml 2010-02-28 02:18:16.667624788 +0300 +++ freemarker-2.3.13.new/build.xml 2010-02-28 02:34:34.031253336 +0300 @@ -51,6 +51,7 @@ <property name="lib.jsp12" location="lib/jsp-api-1.2.jar"/> <property name="lib.jsp20" location="lib/jsp-api-2.0.jar"/> <property name="lib.jsp21" location="lib/jsp-api-2.1.jar"/> + <property name="lib.el" location="lib/el-api.jar"/> <property name="lib.jython" location="lib/jython.jar"/> <!-- If not overridden, use default --> @@ -74,6 +75,7 @@ <path id="compile.classpath"> <path refid="compile.nojsp.classpath"/> <pathelement path="${lib.jsp21}"/> + <pathelement path="${lib.el}"/> </path> <path id="compile.jsp1.classpath"> @@ -104,7 +106,8 @@ <pathelement path="${lib.saxpath}"/> <pathelement path="${lib.xalan}"/> <!-- Xalan is not included with Sun JRE 1.5 with the old classname! --> <pathelement path="${lib.servlet}"/> - <pathelement path="${lib.jsp21}"/> + <pathelement path="${lib.jsp21}"/> + <pathelement path="${lib.el}"/> <pathelement path="${lib.logkit}"/> <pathelement path="${lib.log4j}"/> <pathelement path="${src.dir}"/> @@ -261,6 +264,7 @@ <target name="fetchlibs" unless="all.libs.present" description="fetch build dependencies and put them in lib directory"> <mkdir dir="lib"/> +<!-- <echo>Fetching libraries from server.</echo> <get src="${libs.location}/README.txt" dest="lib/README.txt" usetimestamp="true"/> <get src="${libs.location}/ant.jar" dest="lib/ant.jar" usetimestamp="true"/> @@ -283,6 +287,7 @@ <get src="${libs.location}/jsp-api-2.0.jar" dest="lib/jsp-api-2.0.jar" usetimestamp="true"/> <get src="${libs.location}/jsp-api-2.1.jar" dest="lib/jsp-api-2.1.jar" usetimestamp="true"/> <get src="${libs.location}/xalan.jar" dest="lib/xalan.jar" usetimestamp="true"/> +!--> </target> <target name="init"> @@ -433,7 +438,7 @@ <target depends="init, prepare, javacc" name="compile" description="Compile Java source files"> <mkdir dir="${build.classes.dir}"/> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="lib/rt122.jar" source="1.2" target="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="lib/rt122.jar" source="6" target="6"> <src path="${src.dir}"/> <patternset refid="freemarker.compile"/> <!-- src path="${build.javacc.dir}"/ --> @@ -445,11 +450,11 @@ <antcall target="compile-logkit"/> <antcall target="compile-jdk14"/> <antcall target="compile-jdk15"/> - <antcall target="compile-jsp1"/> +<!-- <antcall target="compile-jsp1"/> --> <antcall target="compile-jsp2"/> <antcall target="compile-jython"/> <antcall target="compile-dom4j"/> - <antcall target="compile-jdom"/> +<!-- <antcall target="compile-jdom"/> --> <antcall target="compile-xalan"/> <antcall target="compile-jaxen"/> <antcall target="compile-rhino"/> @@ -461,7 +466,7 @@ </target> <target name="compile-log4j" if="log4j.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.log4j"/> @@ -469,7 +474,7 @@ </target> <target name="compile-logkit" if="logkit.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.logkit"/> @@ -493,7 +498,7 @@ </target> <target name="compile-jython" if="jython.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.jython"/> @@ -501,7 +506,7 @@ </target> <target name="compile-jsp1"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.jsp1.classpath"/> <patternset refid="freemarker.compile.jsp1"/> @@ -509,7 +514,7 @@ </target> <target name="compile-jsp2"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.jsp2.classpath"/> <patternset refid="freemarker.compile.jsp2"/> @@ -517,7 +522,7 @@ </target> <target name="compile-rhino" if="rhino.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.rhino"/> @@ -525,7 +530,7 @@ </target> <target name="compile-dom4j" if="dom4j.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.dom4j"/> @@ -533,7 +538,7 @@ </target> <target name="compile-jaxen" if="jaxen.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.jaxen"/> @@ -541,7 +546,7 @@ </target> <target name="compile-jdom" if="jdom.available"> - <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.jdom"/> @@ -553,7 +558,7 @@ destdir="${build.classes.dir}" debug="on" optimize="off" - target="1.2" source="1.2"> + target="6" source="6"> <src path="${src.dir}"/> <classpath refid="compile.classpath"/> <patternset refid="freemarker.compile.xalan"/> diff -Nur freemarker-2.3.13/build.xml~ freemarker-2.3.13.new/build.xml~ --- freemarker-2.3.13/build.xml~ 1970-01-01 03:00:00.000000000 +0300 +++ freemarker-2.3.13.new/build.xml~ 2010-02-28 02:26:40.360982530 +0300 @@ -0,0 +1,829 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + +Ant buildfile for 'FreeMarker' application. Compatible with Ant version 1.3. + +Authors: Alex Petrushko <alpet@ocf.berkeley.edu> + Nicholas Cull <run2000@users.sourceforge.net> + Jonathan Revusky <jon@revusky.com> + Attila Szegedi <szegedia@users.sourceforge.net> + +Version: $Id: build.xml,v 1.138.2.4 2006/12/27 16:11:23 szegedia Exp $ + +--> + +<project basedir="." default="jar" name="freemarker"> + + <property name="libs.location" value="http://freemarker.sourceforge.net/jarsforbuild"/> + <property name="repositoryRootDir" value="../../../"/> + + <property file="src/freemarker/version.properties" /> + <property name="src.dir" value="src"/> + <property name="lib.dir" value="lib"/> + <property name="examples.dir" value="examples"/> + <property name="build.dir" value="build"/> + <property name="build.examples.dir" value="build/examples"/> + <property name="build.jython-webapp.dir" value="${build.examples.dir}/jython-webapp"/> + <property name="build.classes.dir" value="build/classes"/> + <property name="build.javacc.dir" value="build/javacc"/> + <property name="build.javadoc.dir" value="build/api" /> + <property name="testcase.dir" value="build/testcase"/> + <property name="dist.dir" value="build/dist"/> + <property name="dist.dir.versioned" value="${dist.dir}/freemarker-${version}"/> + <property name="docgen.dir" value="../docgen" /> + <property name="javadoc.use" value="yes" /> <!-- when tar dir deepth limit is a problem, set to "no" --> + + <property name="freemarker.tar" value="build/freemarker-${version}.tar" /> + <property name="freemarker.gzip" value="${freemarker.tar}.gz" /> + + <property name="lib.jdom" location="lib/jdom.jar"/> + <property name="lib.jaxen" location="lib/jaxen.jar"/> + <property name="lib.xalan" location="lib/xalan.jar"/> + <property name="lib.saxpath" location="lib/saxpath.jar"/> + <property name="lib.log4j" location="lib/log4j.jar"/> + <property name="lib.logkit" location="lib/logkit.jar"/> + <property name="lib.xerces" location="lib/xerces.jar"/> + <property name="lib.junit" location="lib/junit.jar"/> + <property name="lib.dom4j" location="lib/dom4j.jar"/> + <property name="lib.struts" location="lib/struts.jar"/> + <property name="lib.rhino" location="lib/js.jar"/> + <property name="lib.servlet" location="lib/servlet.jar"/> + <property name="lib.jsp12" location="lib/jsp-api-1.2.jar"/> + <property name="lib.jsp20" location="lib/jsp-api-2.0.jar"/> + <property name="lib.jsp21" location="lib/jsp-api-2.1.jar"/> + <property name="lib.el" location="lib/el-api.jar"/> + + <property name="lib.jython" location="lib/jython.jar"/> + <!-- If not overridden, use default --> + <property name="boot.class.path" value="${sun.boot.class.path}"/> + <!-- Path elements to dependencies --> + + <path id="compile.nojsp.classpath"> + <pathelement path="${lib.servlet}"/> + <pathelement path="${lib.jdom}"/> + <pathelement path="${lib.jaxen}"/> + <pathelement path="${lib.dom4j}"/> + <pathelement path="${lib.saxpath}"/> + <pathelement path="${lib.xalan}"/> <!-- Xalan is not included with Sun JRE 1.5! --> + <pathelement path="${lib.jython}"/> + <pathelement path="${lib.logkit}"/> + <pathelement path="${lib.log4j}"/> + <pathelement path="${lib.rhino}"/> + <pathelement path="${java.class.path}"/> + </path> + + <path id="compile.classpath"> + <path refid="compile.nojsp.classpath"/> + <pathelement path="${lib.jsp21}"/> + <pathelement path="${lib.el}"/> + </path> + + <path id="compile.jsp1.classpath"> + <path refid="compile.nojsp.classpath"/> + <pathelement path="${lib.jsp12}"/> + </path> + + <path id="compile.jsp2.classpath"> + <path refid="compile.nojsp.classpath"/> + <pathelement path="${lib.jsp20}"/> + </path> + + <path id="compile.classpath.testcases"> + <pathelement path="${lib.junit}"/> + <pathelement path="${lib.jython}"/> + <pathelement path="${lib.jdom}"/> + <pathelement path="${lib.servlet}"/> + <pathelement path="${lib.jsp20}"/> + </path> + + <path id="compile.classpath.javadoc"> + <pathelement path="${lib.xerces}"/> + <pathelement path="${lib.jdom}"/> + <pathelement path="${lib.dom4j}"/> + <pathelement path="${lib.rhino}"/> + <pathelement path="${lib.jaxen}"/> + <pathelement path="${lib.jython}"/> + <pathelement path="${lib.saxpath}"/> + <pathelement path="${lib.xalan}"/> <!-- Xalan is not included with Sun JRE 1.5 with the old classname! --> + <pathelement path="${lib.servlet}"/> + <pathelement path="${lib.jsp21}"/> + <pathelement path="${lib.el}"/> + <pathelement path="${lib.logkit}"/> + <pathelement path="${lib.log4j}"/> + <pathelement path="${src.dir}"/> + <pathelement path="${build.javacc.dir}"/> + <pathelement path="${java.class.path}"/> + </path> + + <path id="compile.classpath.examples"> + <pathelement path="${lib.servlet}"/> + <pathelement path="${lib.dir}/freemarker.jar"/> + <pathelement path="${lib.struts}"/> + </path> + + <path id="full.classpath"> + <pathelement path="${src.dir}"/> + <pathelement path="${build.classes.dir}" /> + <pathelement path="${lib.servlet}"/> + <pathelement path="${lib.jdom}"/> + <pathelement path="${lib.jaxen}"/> + <pathelement path="${lib.dom4j}"/> + <pathelement path="${lib.saxpath}"/> + <pathelement path="${lib.xalan}"/> <!-- Xalan is not included with Sun JRE 1.5! --> + <pathelement path="${lib.jython}"/> + <pathelement path="${lib.logkit}"/> + <pathelement path="${lib.log4j}"/> + <pathelement path="${java.class.path}"/> + </path> + + + <!-- Pattern set for FreeMarker compilation --> + <patternset id="freemarker.compile"> + <include name="freemarker/cache/**"/> + <include name="freemarker/debug/**"/> + <include name="freemarker/ext/**"/> + <include name="freemarker/log/**"/> + <include name="freemarker/core/**" /> + <include name="freemarker/template/**"/> + <exclude name="freemarker/core/RegexBuiltins.java"/> + <exclude name="freemarker/ext/ant/**"/> + <exclude name="freemarker/ext/beans/EnumModels.java"/> + <exclude name="freemarker/ext/dom/XalanXPathSupport.java"/> + <exclude name="freemarker/ext/dom/SunInternalXalanXPathSupport.java"/> + <exclude name="freemarker/ext/dom/JaxenXPathSupport.java"/> + <exclude name="freemarker/ext/jdom/NodeListModel.java"/> + <exclude name="freemarker/ext/jython/**"/> + <exclude name="freemarker/ext/jsp/TaglibFactory.java"/> + <exclude name="freemarker/ext/jsp/TaglibFactory.java"/> + <exclude name="freemarker/ext/jsp/FreeMarkerPageContext1.java"/> + <exclude name="freemarker/ext/jsp/FreeMarkerPageContext2.java"/> + <exclude name="freemarker/ext/jsp/FreeMarkerJspFactory2.java"/> + <exclude name="freemarker/ext/rhino/**"/> + <exclude name="freemarker/ext/xml/Dom4jNavigator.java"/> + <exclude name="freemarker/ext/xml/JdomNavigator.java"/> + <exclude name="freemarker/log/AvalonLoggerFactory.java"/> + <exclude name="freemarker/log/JDK14LoggerFactory.java"/> + <exclude name="freemarker/log/Log4JLoggerFactory.java"/> + <exclude name="freemarker/template/utility/JythonRuntime.java"/> + </patternset> + + <!-- Pattern set for FreeMarker jar --> + <patternset id="freemarker.jar"> + <include name="freemarker/**"/> + </patternset> + + <patternset id="freemarker.compile.logkit"> + <include name="freemarker/log/AvalonLoggerFactory.java"/> + </patternset> + + <patternset id="freemarker.compile.jdk14"> + <include name="freemarker/log/JDK14LoggerFactory.java"/> + <include name="freemarker/core/RegexBuiltins.java"/> + </patternset> + + <patternset id="freemarker.compile.jdk15"> + <include name="freemarker/ext/beans/EnumModels.java"/> + <include name="freemarker/ext/dom/SunInternalXalanXPathSupport.java"/> + </patternset> + + <patternset id="freemarker.compile.xalan"> + <include name="freemarker/ext/dom/XalanXPathSupport.java"/> + </patternset> + + <patternset id="freemarker.compile.log4j"> + <include name="freemarker/log/Log4JLoggerFactory.java"/> + </patternset> + + <patternset id="freemarker.compile.dom4j"> + <include name="freemarker/ext/xml/Dom4jNavigator.java"/> + </patternset> + + <patternset id="freemarker.compile.jaxen"> + <include name="freemarker/ext/dom/JaxenXPathSupport.java"/> + </patternset> + + <patternset id="freemarker.compile.jdom"> + <include name="freemarker/ext/jdom/NodeListModel.java"/> + <include name="freemarker/ext/xml/JdomNavigator.java"/> + </patternset> + + <patternset id="freemarker.compile.jython"> + <include name="freemarker/ext/ant/**"/> + <include name="freemarker/template/utility/JythonRuntime.java"/> + <include name="freemarker/ext/jython/**"/> + </patternset> + + <patternset id="freemarker.compile.rhino"> + <include name="freemarker/ext/rhino/**"/> + </patternset> + + <patternset id="freemarker.compile.jsp1"> + <include name="freemarker/ext/jsp/FreeMarkerPageContext1.java"/> + </patternset> + + <patternset id="freemarker.compile.jsp2"> + <include name="freemarker/ext/jsp/FreeMarkerPageContext2.java"/> + <include name="freemarker/ext/jsp/FreeMarkerJspFactory2.java"/> + </patternset> + + <!-- Pattern set for FreeMarker test case compilation --> + <patternset id="freemarker.compile.testcases"> + <include name="freemarker/testcase/**"/> + </patternset> + + <!-- Pattern set for FreeMarker test case test files --> + <patternset id="freemarker.testcases"> + <include name="freemarker/testcase/reference/**"/> + <include name="freemarker/testcase/template/**"/> + <include name="freemarker/testcase/servlets/reference/**"/> + <include name="freemarker/testcase/servlets/template/**"/> + <include name="freemarker/testcase/servlets/WEB-INF/**"/> + <include name="freemarker/testcase/*.properties"/> + <include name="freemarker/testcase/*.xml"/> + <include name="freemarker/testcase/models/*.properties"/> + </patternset> + + <!-- Pattern set for FreeMarker JavaDoc --> + <patternset id="freemarker.javadoc.files"> + <exclude name="manual/**"/> + </patternset> + + <!-- Pattern set for FreeMarker distribution --> + <patternset id="freemarker.distribution.src"> + <include name="build.xml"/> + <include name="examples/**"/> + <include name="LICENSE.txt"/> + <include name="README.txt"/> + <include name="src/**"/> + <include name="examples/**"/> + <exclude name="**/CVS/**"/> + <exclude name="**/*.bak"/> + <exclude name="**/src/**/*.class" /> + <exclude name="**/.nbattrs" /> + </patternset> + + <target name="fetchlibs" unless="all.libs.present" description="fetch build dependencies and put them in lib directory"> + <mkdir dir="lib"/> +<!-- + <echo>Fetching libraries from server.</echo> + <get src="${libs.location}/README.txt" dest="lib/README.txt" usetimestamp="true"/> + <get src="${libs.location}/ant.jar" dest="lib/ant.jar" usetimestamp="true"/> + <get src="${libs.location}/dom4j.jar" dest="lib/dom4j.jar" usetimestamp="true"/> + <get src="${libs.location}/emma.jar" dest="lib/emma.jar" usetimestamp="true"/> + <get src="${libs.location}/emma_ant.jar" dest="lib/emma_ant.jar" usetimestamp="true"/> + <get src="${libs.location}/2.3/javacc.jar" dest="lib/javacc.jar" usetimestamp="true"/> + <get src="${libs.location}/jaxen.jar" dest="lib/jaxen.jar" usetimestamp="true"/> + <get src="${libs.location}/2.3/jdom.jar" dest="lib/jdom.jar" usetimestamp="true"/> + <get src="${libs.location}/js.jar" dest="lib/js.jar" usetimestamp="true"/> + <get src="${libs.location}/junit.jar" dest="lib/junit.jar" usetimestamp="true"/> + <get src="${libs.location}/jython.jar" dest="lib/jython.jar" usetimestamp="true"/> + <get src="${libs.location}/log4j.jar" dest="lib/log4j.jar" usetimestamp="true"/> + <get src="${libs.location}/2.3/logkit.jar" dest="lib/logkit.jar" usetimestamp="true"/> + <get src="${libs.location}/2.3/rt122.jar" dest="lib/rt122.jar" usetimestamp="true"/> + <get src="${libs.location}/saxpath.jar" dest="lib/saxpath.jar" usetimestamp="true"/> + <get src="${libs.location}/servlet.jar" dest="lib/servlet.jar" usetimestamp="true"/> + <get src="${libs.location}/struts.jar" dest="lib/struts.jar" usetimestamp="true"/> + <get src="${libs.location}/jsp-api-1.2.jar" dest="lib/jsp-api-1.2.jar" usetimestamp="true"/> + <get src="${libs.location}/jsp-api-2.0.jar" dest="lib/jsp-api-2.0.jar" usetimestamp="true"/> + <get src="${libs.location}/jsp-api-2.1.jar" dest="lib/jsp-api-2.1.jar" usetimestamp="true"/> + <get src="${libs.location}/xalan.jar" dest="lib/xalan.jar" usetimestamp="true"/> +!--> + </target> + + <target name="init"> + <condition property="all.libs.present"> + <and> + <available file="lib/README.txt"/> + <available file="lib/ant.jar"/> + <available file="lib/dom4j.jar"/> + <available file="lib/emma.jar"/> + <available file="lib/emma_ant.jar"/> + <available file="lib/javacc.jar"/> + <available file="lib/jaxen.jar"/> + <available file="lib/jdom.jar"/> + <available file="lib/js.jar"/> + <available file="lib/junit.jar"/> + <available file="lib/jython.jar"/> + <available file="lib/log4j.jar"/> + <available file="lib/logkit.jar"/> + <available file="lib/rt122.jar"/> + <available file="lib/saxpath.jar"/> + <available file="lib/servlet.jar"/> + <available file="lib/struts.jar"/> + <available file="lib/jsp-api-1.2.jar"/> + <available file="lib/jsp-api-2.0.jar"/> + <available file="lib/jsp-api-2.1.jar"/> + <available file="lib/xalan.jar"/> + </and> + </condition> + <antcall target="fetchlibs"/> + <available + property="log4j.available" + classname="org.apache.log4j.Logger" + classpathref="compile.classpath"/> + <available + property="logkit.available" + classname="org.apache.log.Logger" + classpathref="compile.classpath"/> + <available + property="jdk14.available" + classname="java.util.logging.Logger" + classpathref="compile.classpath"/> + <available + property="jdk15.available" + classname="java.lang.Enum" + classpathref="compile.classpath"/> + <available + property="jython.available" + classname="org.python.core.PyObject" + classpathref="compile.classpath"/> + <available + property="jsp21.available" + classname="javax.el.ELResolver" + classpathref="compile.classpath"/> + <available + property="dom4j.available" + classname="org.dom4j.Node" + classpathref="compile.classpath"/> + <available + property="jaxen.available" + classname="org.jaxen.XPath" + classpathref="compile.classpath"/> + <available + property="jdom.available" + classname="org.jdom.Element" + classpathref="compile.classpath"/> + <available + property="rhino.available" + classname="org.mozilla.javascript.Scriptable" + classpathref="compile.classpath"/> + <available + property="xalan.available" + classname="org.apache.xpath.XPathAPI" + classpathref="compile.classpath" /> + </target> + + <!-- The build targets begin here --> + <target depends="" name="clean" description="Erase the deployment tree"> + <delete dir="${build.dir}"/> + <delete dir="${lib.dir}"/> + <delete dir="docs"/> + <delete file="src/freemarker/core/FMParser.java" /> + <delete file="src/freemarker/core/FMParserConstants.java" /> + <delete file="src/freemarker/core/FMParserTokenManager.java" /> + <delete file="src/freemarker/core/SimpleCharStream.java" /> + <delete file="src/freemarker/core/Token.java" /> + <delete file="src/freemarker/core/TokenMgrError.java" /> + </target> + + <target depends="" name="prepare" description="Create the target directories"> + <mkdir dir="${build.dir}"/> + <mkdir dir="${lib.dir}"/> + </target> + + <target depends="" name="javadoc" description="Build the JavaDoc documentation" > + <mkdir dir="${build.javadoc.dir}"/> + <delete includeEmptyDirs="yes"> + <fileset dir="${build.javadoc.dir}" includes="**/*" /> + </delete> + <javadoc author="true" + destdir="${build.javadoc.dir}" + doctitle="FreeMarker ${version}" + packagenames="freemarker.debug, freemarker.template.*, freemarker.core.*, freemarker.ext.*, freemarker.cache.*, freemarker.log.*" + sourcepath="${src.dir}" + version="true" + windowtitle="FreeMarker ${version} API" + classpathref="compile.classpath.javadoc" + use="${javadoc.use}"> + </javadoc> + </target> + + <target name="javacc" + description="Build the JavaCC parser from its grammar file"> + <!-- mkdir dir="${build.javacc.dir}/freemarker/core"/ --> + <copy todir="${build.javacc.dir}/freemarker/core" file="${src.dir}/freemarker/core/ParseException.java" /> + <taskdef name="javacc" classname="org.apache.tools.ant.taskdefs.optional.javacc.JavaCC" classpath="lib/javacc.jar"/> + <javacc + target="${src.dir}/freemarker/core/FMParser.jj" + outputdirectory="src/freemarker/core" + javacchome="lib" + /> + <replace + file="src/freemarker/core/FMParserConstants.java" + token="public interface FMParserConstants" + value="interface FMParserConstants" + /> + <replace + file="src/freemarker/core/FMParserTokenManager.java" + token="public class FMParserTokenManager" + value="class FMParserTokenManager" + /> + <replace + file="src/freemarker/core/Token.java" + token="public class Token" + value="class Token" + /> + <replace + file="src/freemarker/core/SimpleCharStream.java" + token="public final class SimpleCharStream" + value="final class SimpleCharStream" + /> + <replace + file="src/freemarker/core/FMParser.java" + token="enum" + value="ENUM" + /> + </target> + + <target depends="init, prepare, javacc" name="compile" + description="Compile Java source files"> + <mkdir dir="${build.classes.dir}"/> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="lib/rt122.jar" source="1.2" target="1.2"> + <src path="${src.dir}"/> + <patternset refid="freemarker.compile"/> + <!-- src path="${build.javacc.dir}"/ --> + <classpath refid="compile.classpath"/> + </javac> + <rmic base="${build.classes.dir}" classpathref="compile.classpath" + includes="freemarker/debug/impl/Rmi*Impl.class" verify="yes" stubversion="1.2"/> + <antcall target="compile-log4j"/> + <antcall target="compile-logkit"/> + <antcall target="compile-jdk14"/> + <antcall target="compile-jdk15"/> +<!-- <antcall target="compile-jsp1"/> --> + <antcall target="compile-jsp2"/> + <antcall target="compile-jython"/> + <antcall target="compile-dom4j"/> +<!-- <antcall target="compile-jdom"/> --> + <antcall target="compile-xalan"/> + <antcall target="compile-jaxen"/> + <antcall target="compile-rhino"/> + <copy toDir="${build.classes.dir}"> + <fileset + dir="${src.dir}" + excludes="**/CVS/**,**/*.bak,**/*.java,**/*.jj,**/package.html,freemarker/testcase/**"/> + </copy> + </target> + + <target name="compile-log4j" if="log4j.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.log4j"/> + </javac> + </target> + + <target name="compile-logkit" if="logkit.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.logkit"/> + </javac> + </target> + + <target name="compile-jdk14" if="jdk14.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" source="1.4" target="1.4"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.jdk14"/> + </javac> + </target> + + <target name="compile-jdk15" if="jdk15.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" source="1.5" target="1.5"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.jdk15"/> + </javac> + </target> + + <target name="compile-jython" if="jython.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.jython"/> + </javac> + </target> + + <target name="compile-jsp1"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.jsp1.classpath"/> + <patternset refid="freemarker.compile.jsp1"/> + </javac> + </target> + + <target name="compile-jsp2"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.jsp2.classpath"/> + <patternset refid="freemarker.compile.jsp2"/> + </javac> + </target> + + <target name="compile-rhino" if="rhino.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.rhino"/> + </javac> + </target> + + <target name="compile-dom4j" if="dom4j.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.dom4j"/> + </javac> + </target> + + <target name="compile-jaxen" if="jaxen.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.jaxen"/> + </javac> + </target> + + <target name="compile-jdom" if="jdom.available"> + <javac deprecation="off" destdir="${build.classes.dir}" debug="on" optimize="off" bootclasspath="${boot.class.path}" target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.jdom"/> + </javac> + </target> + + <target name="compile-xalan" if="xalan.available"> + <javac deprecation="off" + destdir="${build.classes.dir}" + debug="on" + optimize="off" + target="1.2" source="1.2"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath"/> + <patternset refid="freemarker.compile.xalan"/> + </javac> + </target> + + <target depends="compile" name="jar" description="Create the freemarker.jar"> + <jar basedir="${build.classes.dir}" jarfile="${lib.dir}/freemarker.jar"> + <patternset refid="freemarker.jar"/> + <manifest> + <attribute name="Main-Class" value="freemarker.core.CommandLine" /> + <attribute name="Extension-name" value="FreeMarker" /> + <attribute name="Specification-Title" value="FreeMarker" /> + <attribute name="Specification-Version" value="${versionForMf}" /> + <attribute name="Specification-Vendor" value="Visigoth Software Society" /> + <attribute name="Implementation-Title" value="VSS Java FreeMarker" /> + <attribute name="Implementation-Version" value="${versionForMf}" /> + <attribute name="Implementation-Vendor" value="Visigoth Software Society" /> + </manifest> + </jar> + </target> + + <target depends="compile" name="testcases" description="Build test cases"> + <mkdir dir="${testcase.dir}"/> + <copy toDir="${testcase.dir}"> + <fileset dir="${build.classes.dir}"/> + </copy> + <javac deprecation="on" destdir="${testcase.dir}" debug="on" optimize="off"> + <src path="${src.dir}"/> + <classpath refid="compile.classpath.testcases"/> + <patternset refid="freemarker.compile.testcases"/> + </javac> + + <copy todir="${testcase.dir}"> + <fileset dir="${src.dir}"> + <patternset refid="freemarker.testcases"/> + </fileset> + </copy> + </target> + + <target name="test" depends="compile, testcases" description="Run test cases"> + <junit haltonfailure="off" fork="true"> + <classpath> + <path path="${java.class.path}"/> + <path refid="compile.classpath"/> + <pathelement path="${lib.junit}"/> + <pathelement path="${lib.jdom}"/> + <pathelement path="${build.classes.dir}"/> + <pathelement path="${testcase.dir}"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + + <test + name="freemarker.testcase.TemplateTestSuite" + todir="${testcase.dir}"/> + </junit> + </target> + + <!-- + Reusable task for building example webapps. Invoke with antcall task. + Params: + - webapp: The directory of the webapp relative to the example directory + --> + <target name="example-general-webapp" depends="init" + description="Reusable task for building example webapps. For internal usage only."> + <mkdir dir="${build.examples.dir}/${webapp}"/> + <copy toDir="${build.examples.dir}/${webapp}"> + <fileset dir="${examples.dir}/${webapp}" excludes="**/CVS/**,**/*.bak"/> + </copy> + <javac deprecation="on" destdir="${build.examples.dir}/${webapp}/WEB-INF/classes"> + <src path="${examples.dir}/${webapp}/WEB-INF/classes"/> + <classpath refid="compile.classpath.examples" /> + </javac> + <mkdir dir="${build.examples.dir}/${webapp}/WEB-INF/lib"/> + <copy file="lib/freemarker.jar" toDir="${build.examples.dir}/${webapp}/WEB-INF/lib"/> + </target> + + <target name="example-webapp1" depends="init" description="Build the example webapps"> + <antcall target="example-general-webapp"> + <param name="webapp" value="webapp1"/> + </antcall> + </target> + + <target name="example-webapp2" depends="init" description="Build the example webapps"> + <antcall target="example-general-webapp"> + <param name="webapp" value="webapp2"/> + </antcall> + </target> + + <target name="example-jsp-webapp" depends="init" description="Build the JSP example webapp"> + <antcall target="example-general-webapp"> + <param name="webapp" value="jsp-webapp"/> + </antcall> + </target> + + <target name="example-struts-webapp" depends="init" description="Build the struts example webapp"> + <antcall target="example-general-webapp"> + <param name="webapp" value="struts-webapp"/> + </antcall> + </target> + + <target name="prepare-jython-webapp"> + <property name="twit.jar.loc" location="${build.jython-webapp.dir}/WEB-INF/lib/twit.jar"/> + <uptodate + property="jython-webapp.upToDate" + targetfile="${twit.jar.loc}" + > + <srcfiles dir="examples/jython-webapp/WEB-INF" includes="UpperClassTwitOfTheYearServlet.py"/> + <srcfiles dir="${src.dir}" includes="freemarker/ext/servlet/FreemarkerServlet.java"/> + </uptodate> + + <mkdir dir="${build.jython-webapp.dir}/WEB-INF/lib"/> + <copy toDir="${build.jython-webapp.dir}"> + <fileset dir="${examples.dir}/jython-webapp" excludes="**/CVS/**,**/*.bak"/> + </copy> + + <property name="jythonc" location="${jython.home}/Tools/jythonc/jythonc.py"/> + <property name="freemarker.jar.loc" location="lib/freemarker.jar"/> + <copy file="lib/freemarker.jar" toDir="${build.jython-webapp.dir}/WEB-INF/lib"/> + </target> + + <target name="example-jython-webapp" depends="init, prepare-jython-webapp" if="jython.available" unless="jython-webapp.upToDate" + description="Build the Jython Webapp example code"> + <java fork="true" classname="org.python.util.jython" dir="${build.jython-webapp.dir}/WEB-INF"> + <classpath> + <path refid="compile.classpath"/> + <pathelement location="${freemarker.jar.loc}"/> + </classpath> + <sysproperty key="python.home" value="${jython.home}"/> + <sysproperty key="python.home" value="${jython.home}"/> + <arg value="${jythonc}"/> + <arg value="--core"/> + <arg value="--bean"/> + <arg value="${twit.jar.loc}"/> + <arg value="UpperClassTwitOfTheYearServlet.py"/> + </java> + + <delete dir="${build.jython-webapp.dir}/WEB-INF/jpywork"/> + + </target> + + <target name="examples" + depends="example-webapp1, example-webapp2, example-struts-webapp, example-jsp-webapp, example-jython-webapp"/> + + <target name="fail.logkit" unless="logkit.available"> + <fail message="Can't build dist because LogKit classes are not available."/> + </target> + + <target name="fail.log4j" unless="log4j.available"> + <fail message="Can't build dist because Log4J classes are not available."/> + </target> + + <target name="fail.jdk14" unless="jdk14.available"> + <fail message="Can't build dist because JDK 1.4 classes are not available."/> + </target> + + <target name="fail.jdk15" unless="jdk15.available"> + <fail message="Can't build dist because JDK 1.5 classes are not available."/> + </target> + + <target name="fail.jython" unless="jython.available"> + <fail message="Can't build dist because Jython classes are not available."/> + </target> + + <target name="fail.jsp21" unless="jsp21.available"> + <fail message="Can't build dist because JSP 2.1 classes are not available."/> + </target> + + <target name="fail.rhino" unless="rhino.available"> + <fail message="Can't build dist because Rhino classes are not available."/> + </target> + + <target name="fail.jaxen" unless="jaxen.available"> + <fail message="Can't build dist because Jaxen classes are not available."/> + </target> + + <target name="fail.xalan" unless="xalan.available"> + <fail message="Can't build dist because Xalan classes are not available."/> + </target> + + <target + name="dist" + depends="init, fail.logkit, fail.log4j, fail.jdk14, fail.jdk15, fail.jython, fail.jsp21, fail.rhino, fail.jaxen, fail.xalan, jar" + description="Build the FreeMarker distribution files"> + <delete dir="${dist.dir}" /> + <mkdir dir="${dist.dir}" /> + <mkdir dir="${dist.dir.versioned}" /> + <copy todir="${dist.dir.versioned}" includeEmptyDirs="no"> + <fileset dir="."> + <patternset refid="freemarker.distribution.src"/> + </fileset> + </copy> + <replace + file="${dist.dir.versioned}/README.txt" + token="{version}" + value="${version}" + /> + + <copy todir="${dist.dir.versioned}/lib" includeEmptyDirs="no"> + <fileset file="lib/freemarker.jar" /> + </copy> + + <!-- Generate website pages and copy them to distro --> + <ant dir="${repositoryRootDir}site" target="all"> + <property name="site.offline" value="yes"/> + </ant> + <copy todir="${dist.dir.versioned}/docs"> + <fileset dir="${repositoryRootDir}site/build/site"/> + </copy> + + <!-- Generate manual pages and copy them to distro --> + <ant dir="../docgen" target="all"> + <property name="docgen.offline" value="yes"/> + </ant> + <copy todir="${dist.dir.versioned}/docs/docs" includeEmptyDirs="no"> + <fileset dir="../docgen/build/docs"/> + </copy> + + <antcall target="packdist"/> + </target> + + <target name="packdist"> + <delete file="${freemarker.tar}" /> + <tar tarfile="${freemarker.tar}" basedir="${dist.dir}" /> + <delete file="${freemarker.gzip}" /> + <gzip zipfile="${freemarker.gzip}" src="${freemarker.tar}" /> + <delete file="${freemarker.tar}" /> + </target> + + <target name="packdocs"> + <delete file="build/docs.tar" /> + <tar tarfile="build/docs.tar" basedir="${dist.dir.versioned}/docs" /> + <delete file="build/docs.tar.gz" /> + <gzip zipfile="build/docs.tar.gz" src="build/docs.tar" /> + <delete file="build/docs.tar" /> + </target> + + <target name="packapidocs"> + <delete file="build/apidocs.tar" /> + <tar tarfile="build/apidocs.tar" basedir="build/api" /> + <delete file="build/apidocs.tar.gz" /> + <gzip zipfile="build/apidocs.tar.gz" src="build/apidocs.tar" /> + <delete file="build/apidocs.tar" /> + </target> + +<!-- The following ant target builds a war file for the HelloServlet +and guestbook examples. Once you build the .war file and drop it in +the appropriate directory, you should be able to see the following +URL's: http://localhost:8080/fmexamples/servlet/hello +and: http://localhost:8080/fmexamples/servlet/guestbook --> + + <target name="war-jython-webapp" + depends="example-jython-webapp" if="jython.available"> + <jar jarfile="fm-jython-example.war" basedir="${build.jython-webapp.dir}" /> + </target> + + <target depends="clean, + prepare, + javadoc, + jar, + example-webapp1, example-webapp2, + testcases" + + name="all" + description="Build everything" /> + +</project>