<project name="protobuf" default="jar">
    <target name="protoc">
        <exec executable="protoc">
            <arg value="--java_out=src/main/java"/>
            <arg value="-I../src"/>
            <arg value="../src/google/protobuf/descriptor.proto"/>
        </exec>
    </target>

    <target name="main_compile" depends="protoc">
        <mkdir dir="build/main/java"/>
        <javac srcdir="src/main/java"
               destdir="build/main/java"
               debug="true"/>
    </target>

    <target name="jar" depends="main_compile">
        <jar destfile="protobuf.jar" basedir="build/main/java"/>
    </target>

    <target name="api">
        <mkdir dir="api"/>
        <javadoc destdir="api"
                 windowtitle="Google Protocol Buffers"
                 doctitle="Google Protocol Buffers">
            <fileset dir="src/main/java" includes="**/*.java"/>
        </javadoc>
    </target>
</project>
