spring-security/samples/attributes/build.xml

136 lines
4.3 KiB
XML

<?xml version="1.0"?>
<!--
* Copyright 2004 Acegi Technology Pty Limited
*
* Licensed 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.
*
*
* $Id$
-->
<!--
Build file for the "attributes" sample application.
Demonstrates how to compile an application that has the security
configuration defined by Commons Attributes in its Java source code.
-->
<project name="attributes" default="all" basedir=".">
<property file="build.properties"/>
<property file="project.properties"/>
<path id="attribute-compiler-classpath">
<fileset dir="${lib.dir}">
<include name="**/commons-attributes-compiler-SNAPSHOT.jar"/>
<include name="**/commons-collections.jar"/>
<include name="**/xjavadoc-1.0.jar"/>
</fileset>
</path>
<path id="qa-portalpath">
<pathelement location="classes"/>
<fileset dir="${dist.lib.dir}">
<include name="acegi-security.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="**/spring.jar"/>
<include name="**/aopalliance-*.jar"/>
<include name="**/commons-logging.jar"/>
<include name="**/commons-attributes-api-SNAPSHOT.jar"/>
<include name="**/commons-collections.jar"/>
<include name="**/xml-apis.jar"/>
</fileset>
</path>
<path id="jalopy-classpath">
<fileset dir="${lib.dir}/jalopy">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="attribute-compiler" description="Generate Commons Attributes sources from original sources">
<taskdef name='attribute-compiler'
classname="org.apache.commons.attributes.compiler.AttributeCompiler"
classpathref="attribute-compiler-classpath"/>
<attribute-compiler
destdir="${src.generated.dir}"
attributePackages="net.sf.acegisecurity">
<fileset dir="${src.dir}"/>
</attribute-compiler>
</target>
<target name="compile-classes" description="Compile generated and original sources">
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" classpathref="qa-portalpath">
<src path="${src.dir}"/>
<src path="${src.generated.dir}"/>
</javac>
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="*.xml"/>
</fileset>
</copy>
</target>
<target name="format" description="Formats all project source code">
<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
<classpath refid="jalopy-classpath"/>
</taskdef>
<jalopy fileformat="unix"
convention="${jalopy.xml}"
history="file"
historymethod="adler32"
loglevel="error"
threads="2"
classpathref="qa-portalpath">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
</jalopy>
</target>
<target name="tests" depends="compile-classes" description="Run tests">
<delete dir="${reports.dir}"/>
<mkdir dir="${reports.dir}"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath location="${build.dir}"/>
<classpath refid="qa-portalpath"/>
<formatter type="plain"/>
<batchtest fork="yes" todir="${reports.dir}">
<fileset dir="${build.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest>
</junit>
</target>
<target name="clean" description="Clean output dirs (generated, classes, reports)">
<delete dir="${src.generated.dir}"/>
<delete dir="${build.dir}"/>
<delete dir="${reports.dir}"/>
</target>
<target name="all" depends="clean, attribute-compiler, compile-classes, tests" description="Builds from scratch and runs tests"/>
<target name="execute" description="Runs application (assumes has been built)">
<java fork="true" classpathref="qa-portalpath" classname="sample.attributes.Main"/>
</target>
<target name="release" depends="all" description="Builds a clean release file"/>
</project>