blob: c932800366bc7209d1c326ecaffb9b2e54a7421c [file] [log] [blame]
<project basedir="." default="build" name="Library">
<property environment="env"/>
<property name="service-name" value="Library.aar"/>
<property name="dest.dir" value="target"/>
<property name="axis2.home" value="../../" />
<property name="repository.path" value="${axis2.home}/repository/services" />
<property name="dest.dir.classes" value="${dest.dir}/classes"/>
<property name="dest.dir.lib" value="${dest.dir}/lib"/>
<property name="catalina-modules"
value="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/services"/>
<path id="build.class.path">
<fileset dir="../../lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${dest.dir}"/>
</target>
<target name="prepare" depends="clean">
<mkdir dir="${dest.dir}"/>
<mkdir dir="${dest.dir.classes}"/>
<mkdir dir="${dest.dir.classes}/META-INF"/>
</target>
<target name="build" depends="prepare">
<mkdir dir="${dest.dir}"/>
<mkdir dir="${dest.dir.classes}"/>
<mkdir dir="${dest.dir.classes}/META-INF"/>
<copy file="src/META-INF/services.xml"
tofile="${dest.dir.classes}/META-INF/services.xml"
overwrite="true"/>
<javac debug="on" srcdir="src" destdir="${dest.dir.classes}" includes="sample/**">
<classpath refid="build.class.path"/>
</javac>
<jar basedir="${dest.dir.classes}"
destfile="${dest.dir}/${service-name}"/>
</target>
<target name="generate.service" depends="prepare">
<mkdir dir="${dest.dir}"/>
<mkdir dir="${dest.dir.classes}"/>
<mkdir dir="${dest.dir.classes}/META-INF"/>
<copy file="src/META-INF/services.xml"
tofile="${dest.dir.classes}/META-INF/services.xml"
overwrite="true"/>
<javac debug="on" srcdir="src" destdir="${dest.dir.classes}" includes="sample/**">
<classpath refid="build.class.path"/>
</javac>
<jar basedir="${dest.dir.classes}"
destfile="${repository.path}/${service-name}"/>
</target>
<target name="run.client" depends="prepare">
<mkdir dir="${dest.dir}"/>
<mkdir dir="${dest.dir.classes}"/>
<javac debug="on" srcdir="src" destdir="${dest.dir.classes}" includes="client/**">
<classpath>
<fileset dir="../../lib">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<java classname="client.LibraryServiceClient">
<classpath>
<pathelement location="${dest.dir.classes}"/>
<fileset dir="../../lib">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="copy.to.tomcat" depends="build">
<copy file="${dest.dir}/${service-name}" todir="${catalina-modules}"/>
</target>
</project>