Permalink
Browse files

Resolve issue 31: Maven patch / build on CI Server, from Howard Lewis…

… Ship
  • Loading branch information...
1 parent b5c63ac commit bb83d87f6bf3658b378d31af89377c1edbe6aaf2 @scgilardi scgilardi committed Apr 7, 2009
Showing with 96 additions and 3 deletions.
  1. +6 −0 README.txt
  2. +52 −3 build.xml
  3. +38 −0 pom.xml
View
@@ -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.
+
View
@@ -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>
View
38 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>

0 comments on commit bb83d87

Please sign in to comment.