| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <project default="all" xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:deploy="deploy" xmlns:ant="jelly:ant"> |
| |
| <j:set var="dist.name" value="${pom.artifactId}-${pom.currentVersion}"/> |
| |
| <ant:property name="build.dist.dir" value="${maven.build.dir}/dist"/> |
| <ant:property name="build.temp.dir" value="${maven.build.dir}/temp"/> |
| <ant:property name="build.repo.dir" value="${maven.build.dir}/repos"/> |
| <ant:property name="build.samples.dir" value="${maven.build.dir}/samples"/> |
| <ant:property name="build.samples.services.dir" value="${build.samples.dir}/services"/> |
| <ant:property name="build.samples.clients.dir" value="${build.samples.dir}/clients"/> |
| <ant:property name="mar.name" value="${dist.name}.mar"/> |
| <ant:property name="jar.name" value="${dist.name}.jar"/> |
| <ant:property name="dir.samples" value="samples"/> |
| <ant:property name="dir.config" value="config"/> |
| <ant:property name="apache.license.file" value="LICENSE.txt" /> |
| <ant:property name="readme.file" value="README.txt" /> |
| <ant:property name="release.notes.file" value="release-notes.html" /> |
| |
| <goal name="all" prereqs="jar,mar:create,sample:create,client:create,server:create" /> |
| |
| <goal name="mar:create" prereqs="java:compile"> |
| <ant:property name="metainf.path" value="${build.temp.dir}/module/META-INF" /> |
| <ant:mkdir dir="${metainf.path}" /> |
| <ant:copy file="${basedir}/config/module.xml" todir="${metainf.path}" /> |
| |
| <!-- For the client side --> |
| <copy todir="${build.temp.dir}/module"> |
| <fileset dir="${basedir}/target/classes" > |
| <include name="**/*.class"/> |
| </fileset> |
| </copy> |
| |
| <ant:jar jarfile="${maven.build.dir}/${mar.name}" basedir="${build.temp.dir}/module" /> |
| <delete dir="${build.temp.dir}" /> |
| </goal> |
| |
| <goal name="client:create" prereqs="mar:create"> |
| <ant:property name="client.dist.path" value="${build.repo.dir}/client"/> |
| <ant:mkdir dir="${client.dist.path}" /> |
| <ant:mkdir dir="${client.dist.path}/modules" /> |
| <ant:copy file="${dir.config}/axis2.xml" todir="${client.dist.path}" /> |
| <ant:copy file="${maven.build.dir}/${mar.name}" todir="${client.dist.path}/modules" /> |
| </goal> |
| |
| <goal name="server:create" prereqs="mar:create,sample:create"> |
| <ant:property name="server.dist.path" value="${build.repo.dir}/server"/> |
| <ant:mkdir dir="${server.dist.path}" /> |
| <ant:mkdir dir="${server.dist.path}/modules" /> |
| <ant:mkdir dir="${server.dist.path}/services" /> |
| <ant:copy file="${basedir}/config/axis2.xml" todir="${server.dist.path}" /> |
| <ant:copy file="${maven.build.dir}/${mar.name}" todir="${server.dist.path}/modules" /> |
| <ant:copy todir="${server.dist.path}/services" > |
| <ant:fileset dir="${build.samples.services.dir}"> |
| <ant:include name="**/*.aar" /> |
| </ant:fileset> |
| </ant:copy> |
| </goal> |
| |
| <goal name="sample:compile"> |
| <ant:mkdir dir="${basedir}/target/samples/classes" /> |
| <ant:mkdir dir="${basedir}/target/samples/services" /> |
| |
| <ant:javac srcdir="${dir.samples}/src" destdir="${basedir}/target/samples/classes" debug="on"> |
| <ant:classpath refid="maven.dependency.classpath" /> |
| <ant:classpath path="${basedir}/target/classes" /> |
| </ant:javac> |
| </goal> |
| |
| <goal name="sample:create" prereqs="sample:setup,sample:interop:create"> |
| </goal> |
| |
| <goal name="sample:setup" prereqs="sample:compile"> |
| <ant:mkdir dir="${build.samples.services.dir}" /> |
| <ant:mkdir dir="${build.samples.clients.dir}" /> |
| </goal> |
| |
| <goal name="sample:interop:create" prereqs="sample:compile,sample:setup"> |
| <ant:property name="dir.sample.interop.temp" value="${build.temp.dir}/interop" /> |
| <ant:property name="dir.sample.interopclients.temp" value="${build.temp.dir}/interopclients" /> |
| <ant:property name="interop.service.aar.name" value="RMInteropService.aar" /> |
| <ant:property name="interop.client.jar.name" value="InteropSampleClients.jar" /> |
| |
| <ant:mkdir dir="${build.samples.clients.dir}" /> |
| |
| <ant:mkdir dir="${dir.sample.interop.temp}" /> |
| <ant:mkdir dir="${dir.sample.interop.temp}/META-INF" /> |
| <ant:copy file="${dir.samples}/conf/interop/services.xml" todir="${dir.sample.interop.temp}/META-INF" /> |
| <ant:copy todir="${dir.sample.interop.temp}" > |
| <ant:fileset dir="${maven.build.dir}/samples/classes"> |
| <ant:include name="sandesha2/samples/interop/**/*Service*.class" /> |
| </ant:fileset> |
| </ant:copy> |
| |
| <ant:mkdir dir="${dir.sample.interopclients.temp}" /> |
| <ant:copy todir="${dir.sample.interopclients.temp}" > |
| <ant:fileset dir="${maven.build.dir}/samples/classes"> |
| <ant:include name="sandesha2/samples/interop/**/*Client*.class" /> |
| </ant:fileset> |
| </ant:copy> |
| |
| |
| <ant:jar jarfile="${build.samples.services.dir}/${interop.service.aar.name}" basedir="${dir.sample.interop.temp}" /> |
| <ant:jar jarfile="${build.samples.clients.dir}/${interop.client.jar.name}" basedir="${dir.sample.interopclients.temp}" /> |
| |
| <ant:copy todir="${build.samples.clients.dir}" > |
| <ant:fileset dir="${dir.samples}/conf/interop"> |
| <ant:include name="*.bat" /> |
| <ant:include name="*.sh" /> |
| </ant:fileset> |
| </ant:copy> |
| |
| <!-- <delete dir="${build.temp.dir}" /> --> |
| </goal> |
| |
| |
| <goal name="server.copy.tomcat" prereqs="server:create"> |
| <property environment="env1"/> |
| <property name="webapps" value="${env1.CATALINA_HOME}/webapps"/> |
| <ant:copy file="${build.repo.dir}/server/modules/${mar.name}" todir="${webapps}/axis2/WEB-INF/modules"/> |
| <ant:copy todir="${webapps}/axis2/WEB-INF/services" > |
| <ant:fileset dir="${build.repo.dir}/server/services"> |
| <ant:include name="*.aar" /> |
| </ant:fileset> |
| </ant:copy> |
| </goal> |
| |
| |
| <!-- to transforme htmls to xdocs --> |
| <preGoal name="xdoc:jelly-transform"> |
| <attainGoal name="html2xdoc"/> |
| </preGoal> |
| |
| <goal name="clean"> |
| <delete dir="target"/> |
| <delete dir="${build.temp.dir}" /> |
| <ant:delete> |
| <ant:fileset dir="."> |
| <ant:include name="**/axis.log"/> |
| <ant:include name="**/junit*.properties"/> |
| <ant:include name="**/temp.properties"/> |
| </ant:fileset> |
| </ant:delete> |
| </goal> |
| |
| <!-- ================================================================ --> |
| <!--- Create the Binary Distribution --> |
| <!-- ================================================================ --> |
| |
| <goal name="dist-bin" prereqs="all,javadoc"> |
| <property name="dir.temp.dist.bin.parent" value="${build.temp.dir}/dist-bin" /> |
| <property name="dir.temp.dist.bin" value="${build.temp.dir}/dist-bin/${dist.name}-bin" /> |
| |
| <ant:mkdir dir="${dir.temp.dist.bin}"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/docs"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/services"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/modules"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/lib"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/samples/services"/> |
| <ant:mkdir dir="${dir.temp.dist.bin}/docs/api"/> |
| |
| <ant:copy file="${dir.config}/axis2.xml" todir="${dir.temp.dist.bin}/samples/clients" /> |
| |
| <ant:copy todir="${dir.temp.dist.bin}/docs/api"> |
| <ant:fileset dir="target/docs/apidocs/"> |
| <ant:include name="**"/> |
| </ant:fileset> |
| </ant:copy> |
| |
| <ant:copy todir="${dir.temp.dist.bin}/docs/api"> |
| <ant:fileset dir="target/docs/apidocs/"> |
| <ant:include name="**"/> |
| </ant:fileset> |
| </ant:copy> |
| |
| <ant:copy todir="${dir.temp.dist.bin}/docs"> |
| <ant:fileset dir="xdocs"> |
| <ant:include name="**"/> |
| </ant:fileset> |
| </ant:copy> |
| |
| <!-- <ant:copy todir="${dir.temp.dist.bin}/lib" flatten="true"> |
| <ant:fileset dir="target/lib"> |
| <ant:include name="*.jar"/> |
| </ant:fileset> |
| </ant:copy> --> |
| |
| <ant:copy file="target/${jar.name}" todir="${dir.temp.dist.bin}" /> |
| <ant:copy file="target/${mar.name}" todir="${dir.temp.dist.bin}" /> |
| <ant:copy file="${dir.config}/sandesha2.properties" todir="${dir.temp.dist.bin}" /> |
| <ant:copy file="${apache.license.file}" todir="${dir.temp.dist.bin}" /> |
| <ant:copy file="${release.notes.file}" todir="${dir.temp.dist.bin}" /> |
| <ant:copy file="${readme.file}" todir="${dir.temp.dist.bin}" /> |
| |
| <ant:copy todir="${dir.temp.dist.bin}/samples"> |
| <ant:fileset dir="${build.samples.dir}"> |
| <ant:include name="classes/**/*.class" /> |
| <ant:include name="clients/*.jar" /> |
| <ant:include name="clients/*.bat"/> |
| <ant:include name="clients/*.sh"/> |
| <ant:include name="clients/*.xml"/> |
| </ant:fileset> |
| </ant:copy> |
| |
| <ant:copy todir="${dir.temp.dist.bin}/samples/services"> |
| <ant:fileset dir="${build.repo.dir}/server/services"> |
| <ant:include name="*.aar" /> |
| </ant:fileset> |
| </ant:copy> |
| |
| |
| <mkdir dir="${build.dist.dir}" /> |
| |
| <ant:zip file="${build.dist.dir}/${dist.name}-bin.zip" basedir="${dir.temp.dist.bin.parent}" /> |
| <ant:tar tarfile="${build.dist.dir}/${dist.name}-bin.tar" basedir="${dir.temp.dist.bin.parent}" /> |
| <gzip src="${build.dist.dir}/${dist.name}-bin.tar" zipfile="${build.dist.dir}/${dist.name}-bin.tar.gz" /> |
| |
| <ant:delete file="${build.dist.dir}/${dist.name}-bin.tar" /> |
| |
| </goal> |
| |
| |
| <!-- ================================================================ --> |
| <!--- Create the Source Distribution --> |
| <!-- ================================================================ --> |
| |
| <goal name="dist-src"> |
| |
| <mkdir dir="${build.dist.dir}" /> |
| |
| <ant:zip file="${build.dist.dir}/${dist.name}-src.zip"> |
| <ant:fileset dir="."> |
| <ant:include name="**"/> |
| <ant:exclude name="**/target/**"/> |
| <ant:exclude name="**/.svn/**"/> |
| <ant:exclude name="**/bin/**"/> |
| <ant:exclude name=".*"/> |
| <ant:exclude name="**/*.license"/> |
| </ant:fileset> |
| </ant:zip> |
| |
| <ant:tar tarfile="${build.dist.dir}/${dist.name}-src.tar" longfile="gnu"> |
| <ant:tarfileset dir="."> |
| <ant:include name="**"/> |
| <ant:exclude name="**/target/**"/> |
| <ant:exclude name="**/.svn/**"/> |
| <ant:exclude name="**/bin/**"/> |
| <ant:exclude name=".*"/> |
| <ant:exclude name="**/*.license"/> |
| </ant:tarfileset> |
| </ant:tar> |
| |
| <gzip src="target/${dist.name}-src.tar" zipfile="${build.dist.dir}/${dist.name}-src.tar.gz"/> |
| <ant:delete file="target/${dist.name}-src.tar"/> |
| </goal> |
| |
| |
| </project> |