blob: 5954bb030334721eef51ce8bb5c951983ac7ec6b [file] [log] [blame]
<?xml version="1.0"?>
<!--
==========================================================================
jSieve build file
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
==============================================================================
-->
<project name='jsieve-main' default="main" basedir=".">
<!--
Give user a chance to override without editing this file
(and without typing -D each time he compiles it)
-->
<property file=".ant.properties" />
<property file="${user.home}/.ant.properties" />
<property file="../include.properties" />
<property file="../default.properties" />
<path id="project.class.path">
<pathelement location="${commons-logging.jar}" />
<pathelement location="${log4j.jar}" />
<pathelement location="${junit.jar}" />
<pathelement path="${java.class.path}" />
<pathelement path="${build.classes}" />
</path>
<path id="mail.class.path">
<pathelement location='${mail.jar}' />
<pathelement location='${activation.jar}' />
</path>
<path id="project.test.class.path">
<path refid="project.class.path" />
<path refid="mail.class.path" />
</path>
<import file='../build.xml'/>
<target name="main" depends="run-tests" description=" - main target"/>
<target name="prepare" depends="preprocess" description=" - paparations [internal]">
<CheckMailConditions/>
</target>
<!--
Unless you want to alter the Sieve grammar, expressed by the seive.jjt
file, is built, consider the following processing a black box.
Or zen for the more spiritual amongst you.
-->
<target name="preprocess" description=" - generate source from grammar [internal]">
<!--
Generate JavaCC source inserting parse tree building actions
and the Java source for the parse classes.
-->
<mkdir dir="${build.src}/org/apache/jsieve/parser/generated/address" />
<java classname="jjtree" fork="yes" failonerror="true" dir="${build.src}">
<arg line="${javacc.dir}/sieve/sieve.jjt" />
<classpath>
<pathelement location="${javacc.jar}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
<java classname="jjtree" fork="yes" failonerror="true" dir="${build.src}">
<arg line="${javacc.dir}/address/AddressListParser.jjt" />
<classpath>
<pathelement location="${javacc.jar}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
<!-- Generate Java source from the JavaCC source -->
<java classname="javacc" fork="yes" failonerror="true" dir="${build.src}">
<arg line="${build.src}/org/apache/jsieve/parser/generated/sieve.jj" />
<classpath>
<pathelement location="${javacc.jar}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
<java classname="javacc" fork="yes" failonerror="true" dir="${build.src}">
<arg line="${build.src}/org/apache/jsieve/parser/generated/address/AddressListParser.jj" />
<classpath>
<pathelement location="${javacc.jar}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
</target>
<target name="compile" depends="prepare" description=" - compiles test and main source">
<CompileMain>
<src path="${build.src}" />
<src path="${java.dir}" />
</CompileMain>
<CompileTests/>
</target>
<target name="jar" depends="compile" description=" - jars classes">
<Jar name='' prefix=''/>
<!-- Make jSieve jUnit jar-->
<echo message="Making jSieve jUnit Jar (${name}-tests-${version}.jar)" />
<jar jarfile="${build.lib}/${name}-tests-${version}.jar" basedir="${build.classes.test}">
<include name="org/apache/jsieve/**" />
<include name="META-INF/**" />
<manifest>
<attribute name="Created-By" value='${creator}' />
<attribute name="X-Compile-Source-JDK" value='${jdk.source}' />
<attribute name="X-Compile-Target-JDK" value='${jdk.target}' />
</manifest>
</jar>
<copy todir='${lib.jsieve.dir}' file='${build.lib}/${name}-tests-${version}.jar' />
</target>
<target name="run-tests" depends="jar" description=" - runs all tests">
<RunTests/>
</target>
<target name="clean" description=" - cleans build files">
<Clean/>
</target>
<target name="usage" description=" - prints help">
<Usage/>
</target>
</project>