diff options
author | scgilardi <scgilardi@gmail.com> | 2009-04-07 14:33:54 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2009-04-07 14:33:54 +0000 |
commit | bb83d87f6bf3658b378d31af89377c1edbe6aaf2 (patch) | |
tree | 812acdb30ed53a5d655009d2773be1d2dc9fa857 | |
parent | b5c63ac653ad023e8902e56f7236cfb74156cb9e (diff) |
Resolve issue 31: Maven patch / build on CI Server, from Howard Lewis Ship
-rw-r--r-- | README.txt | 6 | ||||
-rw-r--r-- | build.xml | 55 | ||||
-rw-r--r-- | pom.xml | 38 |
3 files changed, 96 insertions, 3 deletions
diff --git a/README.txt b/README.txt new file mode 100644 index 00000000..32c26600 --- /dev/null +++ b/README.txt @@ -0,0 +1,6 @@ +This library, clojure-contrib, has a dependency on Clojure: the clojure-lang JAR file. This is needed to compile the Clojure classes. +Normally, it is specified using -Dclojure.jar=<path>. + +The nightly-build and stable-build targets are intended for use on the Tapestry360 continuous integration server +(http://tapestry.formos.com/bamboo). They require the presense of the Maven Ant Tasks in the Ant lib folder. + @@ -1,9 +1,9 @@ -<project name="clojure-contrib" default="jar"> +<project name="clojure-contrib" default="jar" xmlns:mvn="urn:maven-artifact-ant"> <description> Pack all clojure-contrib sources into a JAR. Compile those that can be compiled standalone if the clojure.jar property points us to - clojure.jar . + clojure.jar. </description> <property name="src" location="src"/> @@ -13,6 +13,12 @@ <!-- The JAR file to create. --> <property name="jarfile" location="clojure-contrib.jar"/> + <property name="slimjarfile" location="clojure-contrib-slim.jar"/> + + <!-- These make sense for building on tapestry.formos.com --> + + <property name="snapshot.repo.dir" location="/var/www/maven-snapshot-repository"/> + <property name="stable.repo.dir" location="/var/www/maven-repository"/> <target name="init"> <tstamp/> @@ -21,6 +27,7 @@ <target name="clean" description="Remove generated files and directories."> <delete file="${jarfile}"/> + <delete file="${slimjarfile}"/> <delete dir="${build}"/> </target> @@ -143,7 +150,7 @@ </java> </target> - <target name="jar" description="Create jar file." depends="compile_clojure"> + <target name="jar" description="Create jar files." depends="compile_clojure"> <jar jarfile="${jarfile}"> <fileset file="epl-v10.html"/> <fileset dir="${src}" includes="**/*.clj"/> @@ -152,6 +159,48 @@ <attribute name="Class-Path" value="."/> </manifest> </jar> + + <jar jarfile="${slimjarfile}"> + <fileset file="epl-v10.html"/> + <fileset dir="${src}" includes="**/*.clj"/> + <manifest> + <attribute name="Class-Path" value="."/> + </manifest> + </jar> + </target> + <target name="clean-build" depends="clean,compile_clojure,test,jar" + description="Clean build with tests."/> + + <macrodef name="build-and-deploy"> + <attribute name="target-dir" description="Root of Maven repository"/> + <sequential> + <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"/> + + <mvn:pom file="pom.xml" id="contrib.pom"/> + + <mvn:dependencies pomRefId="contrib.pom"/> + + <antcall target="clean-build"> + <param name="clojure.jar" value="${org.clojure:clojure-lang:jar}"/> + </antcall> + + <mvn:deploy file="${jarfile}" pomrefid="contrib.pom"> + <attach file="${slimjarfile}" classifier="slim"/> + <remoteRepository url="file:@{target-dir}"/> + </mvn:deploy> + </sequential> + </macrodef> + + <target name="nightly-build" + description="Build and deploy to nightly (snapshot) repository."> + <build-and-deploy target-dir="${snapshot.repo.dir}"/> + </target> + + <target name="stable-build" description="Build and deploy to stable repository."> + <build-and-deploy target-dir="${stable.repo.dir}"/> + </target> + + </project> diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..d792e246 --- /dev/null +++ b/pom.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.clojure</groupId> + <artifactId>clojure-contrib</artifactId> + <version>1.0-SNAPSHOT</version> + <url>http://clojure.org/</url> + + <description>Clojure user contributions library.</description> + + <licenses> + <license> + <name>Eclipse Public License 1.0</name> + <url>http://opensource.org/licenses/eclipse-1.0.php</url> + <distribution>repo</distribution> + </license> + </licenses> + + <dependencies> + <dependency> + <groupId>org.clojure</groupId> + <artifactId>clojure-lang</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + </dependencies> + + <!-- Source of Clojure snapshot dependencies. --> + + <repositories> + <repository> + <id>tapestry-snapshots</id> + <url>http://tapestry.formos.com/maven-snapshot-repository/</url> + </repository> + </repositories> + +</project>
\ No newline at end of file |