summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-02-21 22:21:00 +0000
committerRich Hickey <richhickey@gmail.com>2009-02-21 22:21:00 +0000
commitd1894dffee839a19699376147c289f8b51582638 (patch)
tree978084da6d38f1110c1efee26957fbe471c8b08e
parent933a0f601e68655f69defd13bb2666a1620371fd (diff)
improved Maven integration [issue 70], patch from hlship
-rw-r--r--build.xml46
-rw-r--r--pom.xml45
2 files changed, 60 insertions, 31 deletions
diff --git a/build.xml b/build.xml
index bc5fcc76..42340156 100644
--- a/build.xml
+++ b/build.xml
@@ -1,8 +1,11 @@
-<project name="clojure" default="all">
+<project name="clojure" default="all" xmlns:mvn="urn:maven-artifact-ant">
<description>
- Build with "ant jar" and then start the REPL with:
- "java -cp clojure.jar clojure.main"
+ Build with "ant jar" and then start the
+ REPL with: "java -cp clojure.jar clojure.main".
+ You will need to install the Maven Ant
+ Tasks to ${ant.home}/lib in order to execute
+ the nightly-build or stable-build targets.
</description>
<property name="src" location="src"/>
@@ -11,8 +14,14 @@
<property name="build" location="classes"/>
<property name="clojure_jar" location="clojure.jar"/>
<property name="slim_jar" location="clojure-slim.jar"/>
+ <property name="src_jar" location="clojure-sources.jar"/>
<property name="clojure.assert-if-lazy-seq" value=""/>
+ <!-- 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" depends="clean">
<tstamp/>
<mkdir dir="${build}"/>
@@ -63,14 +72,43 @@
</manifest>
</jar>
</target>
+
+ <target name="clojure-sources" depends="init"
+ description="Create a JAR of Java sources.">
+ <jar jarfile="${src_jar}" basedir="${jsrc}"/>
+ </target>
<target name="jar" depends="clojure"/>
- <target name="all" depends="clojure,clojure-slim"/>
+ <target name="all" depends="clojure,clojure-slim,clojure-sources"/>
<target name="clean"
description="Remove autogenerated files and directories.">
<delete dir="${build}"/>
</target>
+ <macrodef name="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:deploy file="${clojure_jar}">
+ <pom file="pom.xml"/>
+ <attach file="${src_jar}" classifier="sources"/>
+ <attach file="${slim_jar}" classifier="slim"/>
+ <remoteRepository url="file:@{target-dir}"/>
+ </mvn:deploy>
+ </sequential>
+ </macrodef>
+
+ <target name="nightly-build" depends="clean,all"
+ description="Build and deploy to nightly (snapshot) repository.">
+ <deploy target-dir="${snapshot.repo.dir}"/>
+ </target>
+
+
+ <target name="stable-build" depends="clean,all" description="Build and deploy to stable repository.">
+ <deploy target-dir="${stable.repo.dir}"/>
+ </target>
+
+
</project>
diff --git a/pom.xml b/pom.xml
index 33057bca..926316da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,31 +1,22 @@
<?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>jvm.clojure</groupId>
- <artifactId>clojure-lang</artifactId>
- <name>clojure-lang</name>
- <version>1.0-SNAPSHOT</version>
- <url>http://clojure.org/</url>
- <build>
- <sourceDirectory>src/jvm</sourceDirectory>
- <scriptSourceDirectory>src/clj</scriptSourceDirectory>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimize>true</optimize>
- </configuration>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <directory>src/clj/</directory>
- </resource>
- </resources>
- </build>
+ 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-lang</artifactId>
+ <name>clojure-lang</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://clojure.org/</url>
+
+ <description>Clojure core environment and runtime 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>
+
</project> \ No newline at end of file