<project name="lbaccess" default="usage" basedir=".">

	<property file="build.properties" />

	<!-- The base directory relative to which most targets are built -->
	<property name="base" value="." />

	<property name="source.home" value="./src/java/" />
	<property name="javac.dest" value="./classes" />

	<property name="deprecation" value="on" />
	<property name="debug" value="on" />

	<!-- The stem where most LB core source code is located. -->
	<property name="stem" value="com/logback/access" />

	<path id="access.classpath">
		<pathelement location="${source.home}" />
		<pathelement location="${javac.dest}" />
	</path>


	<!-- ================================================================= -->
	<!--                        TARGETS                                    -->
	<!-- ================================================================= -->



	<!-- ================================================================= -->
	<!-- Default target                                                    -->
	<!-- ================================================================= -->

	<target name="usage">
		<echo>
      
      These are the targets supported by this ANT build scpript:
      
      build - compile all project files, if a certain library is missing, 
              then the compilation of its dependents are skipped.
    </echo>
	</target>

	<target name="prepare">
		<mkdir dir="${javac.dest}" />
	</target>

	<!-- ================================================================= -->
	<!-- Remove all generated files such as compiled class files and test  -->
	<!-- case output.                                                     -->
	<!-- ================================================================= -->
	<target name="clean">
		<delete dir="${javac.dest}/" />
	</target>

	<!-- ================================================================= -->
	<!-- Compile test cases and related source files.                      -->
	<!-- ================================================================= -->
	<target name="build" depends="prepare">
		<javac srcdir="${source.home}" destdir="${javac.dest}" 
			excludes="${stem}/xynz/toto.java" 
			deprecation="${deprecation}" 
			debug="${debug}">
			<classpath refid="access.classpath" />
		</javac>
	</target>


	 <target name="logback-access.jar" depends="build">
	    <delete>
	      <fileset dir=".">
	        <include name="logback-access*.jar"/>
	      </fileset>
	    </delete>

	    <jar jarfile="logback-access.jar" basedir="${javac.dest}"
	         includes="${stem}/**/*.class"
	          excludes="**/UnitTest**">

	      <manifest>
	        <section name="com/logback/access">
	          <attribute name="Implementation-Title" value="LOGBack-access"/>
	          <attribute name="Implementation-Version" value="${version}"/>
	          <attribute name="Implementation-Vendor" value="LOGBack.com"/>
	        </section>
	      </manifest>
	    </jar>
	  </target>


</project>
