<?xml version="1.0" encoding="UTF-8"?>
<project name="toplevel" default="build" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<!--
Build/test script intended to be run by build/test server.
For ordinary development use the separate build scripts.
-->
<target name="clean">
<ant dir="components/core" target="clean" />
<ant dir="apps/planet" target="clean" />
<ant dir="apps/weblogger" target="clean" />
</target>
<target name="build-integrated"
description="Build Core, Planet and Roller together (i.e. Rebuilds Core and Planet jars, uses them to build Roller)">
<ant dir="components/core" target="dist" />
<copy file="components/core/dist/lib/roller-core.jar" todir="tools/roller-core" />
<ant dir="apps/planet" target="dist" />
<copy file="apps/planet/dist/lib/roller-planet-business.jar" todir="tools/roller-planet" />
<ant dir="apps/weblogger" target="dist" />
<ant dir="apps/weblogger" target="apache-release" />
</target>
<target name="build"
description="Build Core, Planet and Roller separately (i.e. uses Core and Planet jars from Subversion)" >
<ant dir="components/core" target="dist" />
<ant dir="apps/planet" target="dist" />
<ant dir="apps/weblogger" target="dist" />
<ant dir="apps/weblogger" target="apache-release" />
</target>
<target name="test">
<ant dir="apps/planet" target="test" />
<ant dir="apps/weblogger" target="tests" />
</target>
<!-- get the ant maven tasks. I wish I could understand ant logic so we could run this whenever the jar is missing -->
<target name="mvn-get">
<mkdir dir="tools/buildtime/maven"/>
<get src="http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.0.7/maven-ant-tasks-2.0.7.jar" dest="tools/buildtime/maven/maven-ant-tasks-2.0.7.jar"/>
</target>
<target name="mvn-init">
<echo>If this fails with a message like ' [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.' try running mvn-get first.</echo>
<xmlproperty file="pom.xml" prefix="pom.xml"/>
<path id="maven-ant-tasks.classpath" path="tools/buildtime/maven/maven-ant-tasks-2.0.7.jar"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath"/>
</target>
<!--This target will place the roller-weblogger.war file in a maven repository alongside with its
corresponding pom.xml file. Before deploying be sure to check the version tag in the
pom_ant_weblogger.xml file.
For real usage change the repository url to http://www.ibiblio.org/maven2 or some other
public repository of your choice. To test deployment localy use somting like file://localhost/xxx -->
<target name="mvn-deploy" depends="build, mvn-init">
<artifact:install-provider artifactId="wagon-ssh" version="1.0-alpha-5"/>
<artifact:pom id="maven.project.weblogger.business.jar" file="apps/weblogger/pom_ant_weblogger_business.xml"/>
<artifact:deploy file="apps/weblogger/dist/lib/roller-business.jar">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.weblogger.business.jar"/>
</artifact:deploy>
<artifact:pom id="maven.project.weblogger.web.jar" file="apps/weblogger/pom_ant_weblogger_web.xml"/>
<artifact:deploy file="apps/weblogger/dist/lib/roller-web.jar">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.weblogger.web.jar"/>
</artifact:deploy>
<artifact:pom id="maven.project.weblogger.war" file="apps/weblogger/pom_ant_weblogger.xml"/>
<artifact:deploy file="apps/weblogger/dist/webapp/roller-weblogger.war">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.weblogger.war"/>
</artifact:deploy>
<artifact:pom id="maven.project.planet.business.jar" file="apps/planet/pom_ant_planet_business.xml"/>
<artifact:deploy file="apps/planet/dist/lib/roller-planet-business.jar">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.planet.business.jar"/>
</artifact:deploy>
<artifact:pom id="maven.project.planet.web.jar" file="apps/planet/pom_ant_planet_web.xml"/>
<artifact:deploy file="apps/planet/dist/webapp/roller-planet-web.jar">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.planet.web.jar"/>
</artifact:deploy>
<artifact:pom id="maven.project.planet.war" file="apps/planet/pom_ant_planet.xml"/>
<artifact:deploy file="apps/planet/dist/webapp/roller-planet.war">
<remoteRepository url="scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository"/>
<pom refid="maven.project.planet.war"/>
</artifact:deploy>
</target>
<!-- Install roller-weblogger.war in the local maven repository -->
<target name="mvn-install" depends="build, mvn-init">
<artifact:pom id="maven.project.weblogger.business.jar" file="apps/weblogger/pom_ant_weblogger_business.xml"/>
<artifact:install file="apps/weblogger/dist/lib/roller-business.jar">
<pom refid="maven.project.weblogger.business.jar"/>
</artifact:install>
<artifact:pom id="maven.project.weblogger.web.jar" file="apps/weblogger/pom_ant_weblogger_web.xml"/>
<artifact:install file="apps/weblogger/dist/lib/roller-web.jar">
<pom refid="maven.project.weblogger.web.jar"/>
</artifact:install>
<artifact:pom id="maven.project.weblogger.war" file="apps/weblogger/pom_ant_weblogger.xml"/>
<artifact:install file="apps/weblogger/dist/webapp/roller-weblogger.war">
<pom refid="maven.project.weblogger.war"/>
</artifact:install>
<artifact:pom id="maven.project.planet.business.jar" file="apps/planet/pom_ant_planet_business.xml"/>
<artifact:install file="apps/planet/dist/lib/roller-planet-business.jar">
<pom refid="maven.project.planet.business.jar"/>
</artifact:install>
<artifact:pom id="maven.project.planet.web.jar" file="apps/planet/pom_ant_planet_web.xml"/>
<artifact:install file="apps/planet/dist/lib/roller-planet-web.jar">
<pom refid="maven.project.planet.web.jar"/>
</artifact:install>
<artifact:pom id="maven.project.planet.war" file="apps/planet/pom_ant_planet.xml"/>
<artifact:install file="apps/planet/dist/webapp/roller-planet.war">
<pom refid="maven.project.planet.war"/>
</artifact:install>
</target>
</project>
|