<project name="LibOpenConnect" default="dist" basedir=".">
	<property name="build" location="build"/>
	<property name="dist"  location="dist"/>
	<property name="src"   location="src"/>

	<property name="jar_lib" location="${dist}/openconnect-wrapper.jar"/>
	<property name="jar_app" location="${dist}/example.jar"/>

	<target name="init">
		<mkdir dir="${build}"/>
	</target>

	<target name="compile" depends="init">
		<javac srcdir="${src}" destdir="${build}" encoding="utf-8"
		       source="1.8" target="1.8" includeantruntime="false"/>
	</target>

	<target name="dist" depends="compile">
		<jar jarfile="${jar_lib}" basedir="${build}"
		     includes="org/infradead/libopenconnect/*" />

		<jar jarfile="${jar_app}" basedir="${build}">
			<manifest>
				<attribute name="Main-Class" value="com.example.LibTest" />
			</manifest>
		</jar>
	</target>

	<target name="clean">
		<delete dir="${build}"/>
		<delete dir="${dist}"/>
	</target>
</project>
