blob: 2e4e91448ad3100fdb7d4c27238ad4e7a9213db5 [file] [log] [blame]
<?xml version="1.0"?>
<project name="axis2" default="quick"
>
<!--
This is an ant build file to
-invoke maven to build the distribution
-copy the created files into the local Maven2 cache
-maybe deploy to a local cache, though that is NPE'ing right now.
-->
<!--
not putting this at the top level as it breaks idea's ant-awareness
xmlns:m2="antlib:org.apache.maven.artifact.ant"
-->
<!--any personal overrides; not read by maven-->
<property file="build.properties"/>
<!--any personal overrides; also read by maven-->
<property file="project.properties"/>
<!--read in project properties, including library versions-->
<property file="etc/project.properties"/>
<target name="default">
</target>
<target name="init" >
<!--macro for maven -->
<property name="maven.commoncmd" value="--emacs" />
<condition property="maven.line"
value="--offline ${maven.commoncmd}">
<istrue value="${offline}"/>
</condition>
<condition property="maven.executable" value="maven.bat">
<os family="windows" />
</condition>
<property name="maven.executable" value="maven" />
<property name="maven.line" value="${maven.commoncmd}" />
<presetdef name="maven">
<exec failonerror="true" executable="${maven.executable}">
<arg line="${maven.line}" />
</exec>
</presetdef>
<!-- location of m2 repository (with new layout) -->
<property name="m2.repository" location="${user.home}/.m2/repository"/>
<!-- original m1 repository -->
<property name="m1.repository" location="${user.home}/.maven/repository"/>
<property name="project.xml" location="etc/project.xml" />
<!-- pull out the value of the project version from the maven1 file-->
<xmlproperty file="${project.xml}"
keeproot="true" semanticAttributes="true" />
<property name="target.dir" location="target"/>
<property name="project.version" value="${axis2_version}" />
<property name="artifact.title" value="${project.id}-${project.version}" />
<property name="target.jar" location="${target.dir}/${artifact.title}.jar"/>
<property name="target.pom" location="${target.dir}/${artifact.title}.pom"/>
<!-- use a proper m2 hierarchy -->
<property name="maven2.groupId" value="org.apache.ws.${project.groupId}"/>
<available file="${basedir}/target/lib/axis-wsdl4j-${axis.wsdl4j.version}.jar" property="jars.present"/>
</target>
<target name="clean" depends="init"
description="clean everything">
<maven>
<arg value="multiproject:clean"/>
</maven>
</target>
<target name="dist" depends="init"
description="make a distribution">
<maven>
</maven>
</target>
<target name="dist-lite" depends="init"
description="make a distribution, skip testing">
<maven>
<arg value="-Dmaven.test.skip=true" />
</maven>
</target>
<target name="create-lib" unless="jars.present" depends="init"
description="creates the libraries">
<maven>
<arg value="create-lib" />
</maven>
</target>
<!-- inline creation of a very minimal pom
Only libraries that absolutely must be present should be listed.
This POM omits a choice of StAX parser, because there are so many.
-->
<target name="m2-pom" depends="init" xmlns:m2="antlib:org.apache.maven.artifact.ant">
<echo message="Creating Pom ${target.pom}" level="verbose"/>
<!--ant1.7's echoxml makes this easier -->
<echo file="${target.pom}"><![CDATA[<project>
<modelVersion>4.0.0</modelVersion>
<groupId>${maven2.groupId}</groupId>
<artifactId>${project.id}</artifactId>
<packaging>jar</packaging>
<version>${project.version}</version>
<dependencies>
<dependency>
<groupId>annogen</groupId>
<artifactId>annogen</artifactId>
<version>${annogen.version}</version>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
<version>${axis.wsdl4j.version}</version>
</dependency>
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>${backport_util_concurrent.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>ws-commons</groupId>
<artifactId>policy</artifactId>
<version>${policy.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons</groupId>
<artifactId>XmlSchema</artifactId>
<version>${XmlSchema.m2.version}</version>
</dependency>
<dependency>
<groupId>ws-commons</groupId>
<artifactId>axiom</artifactId>
<version>${axiom.version}</version>
</dependency>
</dependencies>
</project>
]]></echo>
<m2:pom id="m2.pom" file="${target.pom}"/>
</target>
<target name="m2-wagons" depends="init"
xmlns:m2="antlib:org.apache.maven.artifact.ant">
<property name="wagon.version" value="1.0-alpha-5"/>
<m2:install-provider artifactId="wagon-ssh"
version="${wagon.version}"/>
<m2:install-provider artifactId="wagon-ssh-external"
version="${wagon.version}"/>
<m2:install-provider artifactId="wagon-file"
version="${wagon.version}"/>
<m2:install-provider artifactId="wagon-ftp"
version="${wagon.version}"/>
</target>
<target name="ready-to-deploy" depends="m2-pom" />
<target name="m2-install" depends="ready-to-deploy"
description="install the libray into the local m2 repository"
xmlns:m2="antlib:org.apache.maven.artifact.ant">
<m2:install file="${target.jar}">
<pom refid="m2.pom"/>
</m2:install>
</target>
<target name="m2-filesys-deploy" depends="ready-to-deploy"
xmlns:m2="antlib:org.apache.maven.artifact.ant">
<fail unless="filesys.url">
filesys.url needs to be set to a file: url of the local destination
for in-filesystem deployment
</fail>
<m2:deploy file="${target.jar}">
<remoteRepository url="${filesys.url}"/>
<pom refid="m2.pom"/>
</m2:deploy>
</target>
<target name="installed"
description="locally installed"
depends="dist-lite,m2-install" />
<target name="quick" depends="create-lib"
description="make a distribution">
<mkdir dir="${basedir}/target/classes/"/>
<path id="classpath">
<fileset dir="${basedir}/target/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<javac srcdir="${basedir}/modules"
destdir="${basedir}/target/classes/"
debug="true"
source="1.4"
classpathref="classpath">
<include name="addressing/src/**/*.java"/>
<include name="adb/src/**/*.java"/>
<include name="codegen/src/**/*.java"/>
<include name="common/src/**/*.java"/>
<include name="core/src/**/*.java"/>
<include name="integration/src/**/*.java"/>
<include name="saaj/src/**/*.java"/>
<include name="samples/src/**/*.java"/>
<include name="security/src/**/*.java"/>
<include name="wsdl/src/**/*.java"/>
<include name="xml/src/**/*.java"/>
<include name="doom/src/**/*.java"/>
</javac>
<copy todir="${basedir}/target/classes/">
<fileset dir="${basedir}/modules/common/src">
<include name="**/*.properties"/>
<include name="**/*.xsl"/>
</fileset>
<fileset dir="${basedir}/modules/core/conf">
<include name="**/*.properties"/>
</fileset>
<fileset dir="${basedir}/modules/core/src">
<include name="**/*axis2*.xml"/>
</fileset>
<fileset dir="${basedir}/modules/codegen/src">
<include name="**/*.properties"/>
<include name="**/*.xsl"/>
<include name="**/*.xsd"/>
</fileset>
</copy>
<mkdir dir="${basedir}/target/repo/modules"/>
<copy todir="${basedir}/target/repo/modules">
<fileset dir="${basedir}/modules/addressing/target">
<include name="**/*.mar"/>
</fileset>
<fileset dir="${basedir}/modules/security/target">
<include name="**/*.mar"/>
</fileset>
</copy>
<copy todir="${basedir}/target/repo">
<fileset dir="${basedir}/modules/core/src/org/apache/axis2/deployment">
<include name="axis2.xml"/>
</fileset>
</copy>
</target>
<target name="diag" depends="init">
<!-- probably ant 1.7+ only -->
<diagnostics/>
<echoproperties/>
</target>
</project>