Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / CaptureMJPEG http://capturemjpeg.lilik.it/

CaptureMJPEG, a processing library for Motion JPEG stream. CaptureMJPEG is released under the LGPLv3 license.

Clone this repository (size: 3.3 MB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/capturemjpeg
hg clone ssh://hg@bitbucket.org/nolith/capturemjpeg

CaptureMJPEG / build.xml

Tag
rc1
<?xml version="1.0"?>
<!-- build file for CaptureMJPEG library -->
<!-- Created by: Alessio Caiazza &lt;ac@abisso.org&gt;  -->

<project name="CaptureMJPEG" default="build" basedir=".">
    <import file="user_pref.xml"/>

    <path id="classpath">
        <pathelement location="${commons-httpclient}"/>
        <pathelement location="${commons-logging}"/>
        <pathelement location="${commons-codec}"/>
        <pathelement location="${processing-core}"/>
    </path>

    <!-- 
        Build all Java source files into destdir.    This is common in Java
        projects: the compile target is trivial, since it just says to build
        everything.  Fancier compiler targets are easy if you want to build
        just one file at a time.
    -->
    <target name="build" depends="init">
        <javac srcdir="${src}" 
            destdir="${build}"
            debug="${compile.debug}"
            excludes="it/lilik/capturemjpeg/**/*Test.java,it/lilik/capturemjpeg/*Test.java" 
            source="1.4"
            target="1.4">
            <classpath refid="classpath"/>  
        </javac>
        <!-- <copy todir="${build}">
            <fileset dir="${src}" excludes="**/*.java"/>
        </copy> -->
    </target>

    <target name="download_deps">
        <mkdir dir="${libs}"/> 
        <!-- commons-httpclient -->
        <get src="http://mirror.tomato.it/apache/httpcomponents/commons-httpclient/binary/commons-httpclient-3.1.tar.gz" dest="${libs}/commons-httpclient-3.1.tar.gz" verbose="on" usetimestamp="on" />
        <gunzip src="${libs}/commons-httpclient-3.1.tar.gz" />
        <untar src="${libs}/commons-httpclient-3.1.tar" dest="${libs}">
            <patternset>
                <include name="commons-httpclient-3.1/commons-httpclient-3.1.jar"/>
            </patternset>
        </untar>
        <move file="${libs}/commons-httpclient-3.1/commons-httpclient-3.1.jar" todir="${libs}" />
        <delete file="${libs}/commons-httpclient-3.1.tar.gz" />
        <delete file="${libs}/commons-httpclient-3.1.tar" />
        <delete dir="${libs}/commons-httpclient-3.1" />
        <!-- commons-logging -->
        <get src="http://archive.apache.org/dist/commons/logging/binaries/commons-logging-1.0.4.tar.gz" dest="${libs}/commons-logging-1.0.4.tar.gz" verbose="on" usetimestamp="on" />
        <gunzip src="${libs}/commons-logging-1.0.4.tar.gz" />
        <untar src="${libs}/commons-logging-1.0.4.tar" dest="${libs}">
            <patternset>
                <include name="commons-logging-1.0.4/commons-logging.jar"/>
            </patternset>
        </untar>
        <move file="${libs}/commons-logging-1.0.4/commons-logging.jar" todir="${libs}" />
        <delete file="${libs}/commons-logging-1.0.4.tar.gz" />
        <delete file="${libs}/commons-logging-1.0.4.tar" />
        <delete dir="${libs}/commons-logging-1.0.4" />
        <!-- commons-codec -->
        <get 
src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.2.tar.gz" 
           dest="${libs}/commons-codec-1.2.tar.gz" 
           verbose="on" usetimestamp="on" />
        <gunzip src="${libs}/commons-codec-1.2.tar.gz" />
        <untar src="${libs}/commons-codec-1.2.tar" dest="${libs}">
            <patternset>
                <include name="commons-codec-1.2/commons-codec-1.2.jar"/>
            </patternset>
        </untar>
        <move file="${libs}/commons-codec-1.2/commons-codec-1.2.jar" todir="${libs}" />
        <delete file="${libs}/commons-codec-1.2.tar.gz" />
        <delete file="${libs}/commons-codec-1.2.tar" />
        <delete dir="${libs}/commons-codec-1.2" />
</target>
    <!--
        init is a target that sets things up for the build.  Since we use the
        built-in ant function mkdir, it will only make the directory if it
        does not already exist.
    -->
    <target name="init">
        <mkdir dir="${build}"/>
        <mkdir dir="${docs}" />
        <mkdir dir="${docs}/api" />
    </target>


    <!--
    <target name="run" depends="build">
        <java classname="${main.class}" 
            fork="true" 
            dir="." 
            classpath="${build}" 
            maxmemory="500m">
            <classpath refid="classpath"/>
            <arg value="-g"/>
        </java>
    </target>
    -->
    <!--
        Always include a clean target to get rid of all the extra files
        created by the build process, so you can save storage safely, without
        thinking.    Also: sometimes you'll want to do a completely fresh build,
        such as when changing to a new version of the JDK.
    -->
    <target name="clean" depends="clean-doc" description="Removes previous build">
        <delete dir="${build}"/>
        <delete dir="${release}"/>
    </target>



    <target name="jar" depends="build, deploy-init">
        <jar jarfile="${release}/capturemjpeg/library/capturemjpeg.jar">
            <fileset dir="${build}"
                     excludes="**/*Test.class,**/CaptureToFile.class"/>
            <manifest>
                <attribute name="Built-By" value="${user.name}"/>
            </manifest>
        </jar>
    </target> 
    
    

  <target name="deploy-init" depends="">
    <mkdir dir="${release}"/>
    <mkdir dir="${release}/capturemjpeg"/>
    <mkdir dir="${release}/capturemjpeg/library"/>
    <mkdir dir="${release}/capturemjpeg/licenses"/>
    <mkdir dir="${release}/capturemjpeg/documentation"/>
  </target>

  <target name="deploy" depends="jar, doc">
    <!-- copy libs -->
    <copy todir="${release}/capturemjpeg/library">
      <fileset dir="${libs}"/>
    </copy>
    <!-- copy licenses -->
    <copy todir="${release}/capturemjpeg/licenses">
      <fileset dir="./licenses"/>
    </copy>
    <!-- copy documentation -->
    <copy todir="${release}/capturemjpeg/documentation">
      <fileset dir="${docs}/api"/>
    </copy>
    <!-- create zip file -->
    <zip destfile="${release}/capturemjpeg.zip"
         basedir="${release}"
         excludes="capturemjpeg.zip"/>
  </target>

    <target name="doc" depends="init,clean-doc" description="generate docs">
      <javadoc packagenames="it.lilik.capturemjpeg.*"
               destdir="${docs}/api"
               access="package"
               source="1.4"
               author="true"
               version="true"
               use="true"
               windowtitle="CaptureMJPEG API">
        <classpath refid="classpath"/>
        <fileset dir="${src}" defaultexcludes="yes">
            <include name="it/lilik/capturemjpeg/**"/>
            <!-- exclude JUnit from documentation -->
            <exclude name="it/lilik/capturemjpeg/**/*Test.java"/>
            <exclude name="it/lilik/capturemjpeg/*Test.java"/>  
        </fileset>
        <doctitle><![CDATA[<h1>CaptureMJPEG</h1>]]></doctitle>
        <bottom><![CDATA[<i>Copyright &#169; 2008 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.</i>]]></bottom>
        <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
        <link href="http://hc.apache.org/httpclient-3.x/apidocs/"/>
        <link href="http://dev.processing.org/reference/core/javadoc/"/>
      </javadoc>
    </target>

    <target name="clean-doc">
        <delete dir="${docs}/api"/>
    </target>
</project>