blob: b16e636e6b3b334e3ca77a2b26cc79b78432cb75 [file] [log] [blame]
<!--
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
https://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="fortress" default="test" basedir="../../">
<target name="init">
<!-- ########### Project specific properties ########################### -->
<property name="name" value="fortress"/>
<property name="version" value="1.0.0-rc1"/>
<property name="title" value="Fortress Access Management Samples LDAP SDK ${version}"/>
<property name="package.samples" value="org.apache.directory.fortress.*"/>
<property name="project.name" value="Fortress Access Management SDK"/>
<!-- ########### Env specific properties ########################### -->
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="src.test.dir" value="${src.dir}/test/java"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.test-classes.dir" value="${build.dir}/test-classes"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="dist.jar" value="${dist.dir}/${name}-${version}.jar"/>
<property name="dist.test.jar" value="${dist.dir}/${name}Tst-${version}.jar"/>
<!-- ########### Fortress Dependencies ########################### -->
<property name="config.dir" value="${basedir}/config"/>
<property name="commons-config.jar" value="${lib.dir}/commons-configuration-1.6.jar"/>
<property name="commons-lang.jar" value="${lib.dir}/commons-lang-2.4.jar"/>
<property name="commons-collections.jar" value="${lib.dir}/commons-collections-3.2.1.jar"/>
<property name="commons-pool.jar" value="${lib.dir}/commons-pool-1.5.2.jar"/>
<property name="commons-logging.jar" value="${lib.dir}/commons-logging-1.1.1.jar"/>
<property name="commons-beanutils.jar" value="${lib.dir}/commons-beanutils-1.8.0.jar"/>
<property name="jgraph.jar" value="${lib.dir}/jgrapht-jdk1.6.jar"/>
<property name="log4j.jar" value="${lib.dir}/log4j-1.2.8.jar"/>
<property name="junit.jar" value="${lib.dir}/junit-4.4.jar"/>
<!-- ########### Test properties ########################### -->
<property name="test.sample.entry" value="org.apache.directory.fortress.core.samples.AllSamplesJUnitTest"/>
<property name="test.failonerror" value="false" />
<property name="test.showoutput" value="yes" />
<property name="javac.optimize" value="false"/>
<property name="javac.debug" value="true"/>
<property name="javac.deprecation" value="true"/>
<!-- ########### Define classpaths ########################### -->
<!-- This is used for the JUnit Tests -->
<path id="test.class.path">
<path location="${config.dir}"/>
<pathelement location="${build.test-classes.dir}"/>
<pathelement location="${dist.jar}"/>
<pathelement location="${jgraph.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${log4j.jar}"/>
<pathelement location="${commons-config.jar}"/>
<pathelement location="${commons-lang.jar}"/>
<pathelement location="${commons-pool.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${commons-collections.jar}"/>
<pathelement location="${commons-beanutils.jar}"/>
</path>
</target>
<!-- ########### Clean the distribution packages ##################### -->
<target name="clean" depends="init" description="removes generated files">
<delete dir="${build.test-classes.dir}"/>
</target>
<target name="compile-test" depends="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.test-classes.dir}"/>
<javac destdir="${build.test-classes.dir}"
srcdir="${src.test.dir}"
classpath="${test.class.path}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
optimize="${javac.optimize}">
<classpath refid="build.class.path"/>
</javac>
</target>
<!-- ############### run junit samples tests ############################### -->
<target name="test" depends="compile-test" description="runs (junit) sample unit tests">
<echo message="Run the Fortress sample JUnit tests..."/>
<junit fork="yes" haltonfailure="${test.failonerror}" showoutput="${test.showoutput}">
<classpath refid="test.class.path"/>
<formatter type="plain" usefile="false"/>
<test name="${test.sample.entry}"/>
</junit>
</target>
<target name="build-jar-test" depends="compile-test">
<mkdir dir="${dist.dir}"/>
<jar jarfile="${dist.test.jar}">
<fileset dir="${build.test-classes.dir}"/>
<metainf dir="${basedir}" includes="LICENSE.txt,NOTICE.txt"/>
<manifest>
<attribute name="Created-By" value="${vendor} - ${project.name} dev team"/>
<attribute name="Implementation-Vendor" value="${vendor}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Specification-Title" value="${title}"/>
<attribute name="Package" value="${package}"/>
<attribute name="Extension-Name" value="${name}"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Compile-JDK" value="${java.runtime.version}"/>
<attribute name="Test-VM" value="${java.vm.version}"/>
</manifest>
</jar>
</target>
</project>