<?xml version="1.0" encoding="UTF-8"?>

 <project name="commons-compress" default="package" basedir=".">

  <!-- ====================================================================== -->
  <!-- Build environment properties                                           -->
  <!-- ====================================================================== -->

  <property file="build.properties"/>

  <property name="build.name" value="commons-compress"/>
  <property name="build.version" value="1.21"/>
  <property name="build.finalName" value="${build.name}-${build.version}"/>
  <property name="build.dir" value="target"/>
  <property name="build.javadocDir" value="${build.dir}/site/apidocs"/>
  <property name="build.outputDir" value="${build.dir}/classes"/>
  <property name="build.srcDir.0" value="src/main/java"/>
  <property name="build.resourceDir.0" value="src/main/resources"/>
  <property name="build.resourceDir.1" value="."/>

  <property name="commons.osgi.dynamicImport" value=""/>
  <property name="commons.osgi.excludeDependencies" value="true"/>
  <property name="commons.osgi.export" value="org.apache.commons.compress;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.ar;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.arj;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.cpio;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.dump;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.examples;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.jar;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.sevenz;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.tar;version=&quot;${build.version}&quot;,org.apache.commons.compress.archivers.zip;version=&quot;${build.version}&quot;,org.apache.commons.compress.changes;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.bzip2;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.deflate;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.deflate64;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.gzip;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.lz4;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.lz77support;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.lzma;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.lzw;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.pack200;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.snappy;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.xz;version=&quot;${build.version}&quot;,org.apache.commons.compress.compressors.z;version=&quot;${build.version}&quot;,org.apache.commons.compress.harmony.archive.internal.nls;version=&quot;${build.version}&quot;,org.apache.commons.compress.harmony.pack200;version=&quot;${build.version}&quot;,org.apache.commons.compress.harmony.unpack200;version=&quot;${build.version}&quot;,org.apache.commons.compress.harmony.unpack200.bytecode;version=&quot;${build.version}&quot;,org.apache.commons.compress.harmony.unpack200.bytecode.forms;version=&quot;${build.version}&quot;,org.apache.commons.compress.java.util.jar;version=&quot;${build.version}&quot;,org.apache.commons.compress.parallel;version=&quot;${build.version}&quot;,org.apache.commons.compress.utils;version=&quot;${build.version}&quot;"/>
  <property name="commons.osgi.import" value="org.tukaani.xz;resolution:=optional,org.objectweb.asm;resolution:=optional,javax.crypto;resolution:=optional,javax.crypto.spec;resolution:=optional"/>
  <property name="commons.osgi.private" value=""/>
  <property name="commons.osgi.symbolicName" value="org.apache.commons.compress"/>

  <property name="compiler.source" value="1.8"/>
  <property name="compiler.target" value="1.8"/>


  <!-- ====================================================================== -->
  <!-- Defining classpaths                                                    -->
  <!-- ====================================================================== -->

  <path id="build.classpath">
    <fileset dir="lib">
      <include name="**/*.jar">
      </include>
    </fileset>
  </path>

  <!-- ====================================================================== -->
  <!-- Cleaning up target                                                     -->
  <!-- ====================================================================== -->

  <target name="clean" description="Clean the output directory">
    <delete dir="${build.dir}"/>
  </target>

  <!-- ====================================================================== -->
  <!-- Compilation target                                                     -->
  <!-- ====================================================================== -->

  <target name="compile" description="Compile the code">
    <mkdir dir="${build.outputDir}"/>
    <javac destdir="${build.outputDir}" 
           encoding="iso-8859-1" 
           nowarn="false" 
           debug="true" 
           optimize="false" 
           deprecation="true" 
           target="${compiler.target}" 
           verbose="false" 
           fork="false" 
           source="${compiler.source}">
      <src>
        <pathelement location="${build.srcDir.0}"/>
      </src>
      <classpath refid="build.classpath"/>
    </javac>
    <mkdir dir="${build.outputDir}/META-INF"/>
    <copy todir="${build.outputDir}/META-INF">
      <fileset dir="${build.resourceDir.1}">
        <include name="NOTICE.txt"/>
        <include name="LICENSE.txt"/>
      </fileset>
    </copy>
  </target>

  <!-- ====================================================================== -->
  <!-- Javadoc target                                                         -->
  <!-- ====================================================================== -->

  <target name="javadoc" description="Generates the Javadoc of the application">
    <mkdir dir="${build.javadocDir}"/>
    <javadoc sourcepath="${build.srcDir.0}" 
             packagenames="*" 
             destdir="${build.javadocDir}" 
             access="protected" 
             verbose="false" 
             encoding="iso-8859-1" 
             version="true" 
             use="true" 
             author="true" 
             splitindex="false" 
             nodeprecated="false" 
             nodeprecatedlist="false" 
             notree="false" 
             noindex="false" 
             nohelp="false" 
             nonavbar="false" 
             serialwarn="false" 
             source="${compiler.source}" 
             linksource="true" 
             breakiterator="false">
      <classpath refid="build.classpath"/>
    </javadoc>
  </target>

  <!-- ====================================================================== -->
  <!-- Package target                                                         -->
  <!-- ====================================================================== -->

  <target name="package" depends="compile" description="Package the application">
    <jar jarfile="${build.dir}/${build.finalName}.jar" 
         compress="true" 
         index="false" 
         basedir="${build.outputDir}" 
         excludes="**/package.html">
      <manifest>
        <attribute name="Bundle-SymbolicName" value="${commons.osgi.symbolicName}"/>
        <attribute name="Bundle-Version" value="${build.version}"/>
		<attribute name="Export-Package" value="${commons.osgi.export}"/>
		<attribute name="Import-Package" value="${commons.osgi.import}"/>
      </manifest>
    </jar>
  </target>

</project>
