Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add build script and POM template for Hudson releases

  • Loading branch information...
commit 7fe53548931885fdf5def70f54c447fd514c49bd 1 parent 0a50e20
Stuart Sierra and Russ Olsen authored
Showing with 139 additions and 0 deletions.
  1. +77 −0 pom.template.xml
  2. +62 −0 script/build
View
77 pom.template.xml
@@ -0,0 +1,77 @@
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.clojure</groupId>
+ <artifactId>clojurescript</artifactId>
+ <!-- Version number will be replaced by script/build -->
+ <version>CLOJURESCRIPT_VERSION</version>
+ <packaging>jar</packaging>
+ <name>ClojureScript</name>
+
+ <url>https://github.com/clojure/clojurescript</url>
+
+ <description>
+ ClojureScript compiler and core 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>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.javascript</groupId>
+ <artifactId>closure-compiler</artifactId>
+ <version>r1592</version>
+ </dependency>
+ <dependency>
+ <groupId>org.clojure</groupId>
+ <artifactId>google-closure-library</artifactId>
+ <version>0.0-790</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mozilla</groupId>
+ <artifactId>rhino</artifactId>
+ <version>1.7R3</version>
+ </dependency>
+ </dependencies>
+
+ <developers>
+ <developer><id>abedra</id><name>Aaron Bedra</name></developer>
+ <developer><id>alandipert</id><name>Alan Dipert</name></developer>
+ <developer><id>amalloy</id><name>Alan Malloy</name></developer>
+ <developer><id>aredington</id><name>Alex Redington</name></developer>
+ <developer><id>billdozr</id><name>Alen Ribic</name></developer>
+ <developer><id>bobby</id><name>Bobby Calderwood</name></developer>
+ <developer><id>brentonashworth</id><name>Brenton Ashworth</name></developer>
+ <developer><id>Chouser</id><name>Chris Houser</name></developer>
+ <developer><id>devn</id><name>Devin Walters</name></developer>
+ <developer><id>ffailla</id><name>Frank Failla</name></developer>
+ <developer><id>fogus</id><name>Fogus</name></developer>
+ <developer><id>hozumi</id><name>Takahiro Hozumi</name></developer>
+ <developer><id>hugoduncan</id><name>Hugo Duncan</name></developer>
+ <developer><id>jessmartin</id><name>Jess Martin</name></developer>
+ <developer><id>jli</id><name>John Li</name></developer>
+ <developer><id>juergenhoetzel</id><name>Jürgen Hötzel</name></developer>
+ <developer><id>levand</id><name>Luke VanderHart</name></developer>
+ <developer><id>lynaghk</id><name>Kevin Lynagh</name></developer>
+ <developer><id>michalmarczyk</id><name>Micha Marczyk</name></developer>
+ <developer><id>pmbauer</id><name>Paul Michael Bauer</name></developer>
+ <developer><id>redinger</id><name>Christopher</name></developer>
+ <developer><id>richhickey</id><name>Rich Hickey</name></developer>
+ <developer><id>stuarthalloway</id><name>Stuart Halloway</name></developer>
+ <developer><id>stuartsierra</id><name>Stuart Sierra</name></developer>
+ <developer><id>swannodette</id><name>David Nolen</name></developer>
+ <developer><id>thickey</id><name>Tom Hickey</name></developer>
+ <developer><id>wilkes</id><name>Wilkes Joiner</name></developer>
+ </developers>
+
+ <scm>
+ <connection>scm:git:git://github.com/clojure/clojurescript.git</connection>
+ <developerConnection>scm:git:git@github.com:clojure/clojurescript.git</developerConnection>
+ <url>https://github.com/clojure/clojurescript</url>
+ </scm>
+</project>
View
62 script/build
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+
+# This script must be run within the ClojureScript top-level project
+# directory.
+
+set -e
+
+cd `dirname $0`/..
+
+DATE=`date '+%Y%m%d%H%M%S'`
+WORKING="clojurescript_release_$DATE"
+mkdir "$WORKING"
+
+POM_TEMPLATE="pom.template.xml"
+
+# The command `git describe --match v0.0` will return a string like
+#
+# v0.0-856-g329708b
+#
+# where 856 is the number of commits since the v0.0 tag. It will always
+# find the v0.0 tag and will always return the total number of commits (even
+# if the tag is v0.0.1).
+REVISION=`git describe --match v0.0`
+
+# Extract the version number from the string. Do this in two steps so
+# it is a little easier to understand.
+REVISION=${REVISION:5} # drop the first 5 characters
+REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
+
+TAG=r$REVISION
+
+POM_FILE="$WORKING/clojurescript-0.0-$REVISION.pom"
+JAR_FILE="$WORKING/clojurescript-0.0-$REVISION.jar"
+
+
+# `jar cf` errors on duplicate entries,
+# so we have to assemble the directory manually
+mkdir "$WORKING/jar_contents"
+
+cp -R epl-v10.html src/clj/cljs src/cljs/cljs src/cljs/clojure \
+ "$WORKING/jar_contents"
+
+jar cf "$JAR_FILE" -C "$WORKING/jar_contents" .
+
+sed -e s/CLOJURESCRIPT_VERSION/0.0-$REVISION/ < "$POM_TEMPLATE" > "$POM_FILE"
+
+mvn install:install-file -Dfile="$JAR_FILE" -DpomFile="$POM_FILE"
+
+# For Hudson server
+if [ "$HUDSON" == "true" ]; then
+ echo "Creating tag $TAG"
+ git tag -f $TAG
+ # TODO git push
+
+ export PATH="$PATH:/var/lib/hudson/tools/Maven_2.2.1/bin"
+ export JAVA_HOME=/usr/lib/jvm/java-1.6.0
+ mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile="$POM_FILE" -Dfile="$JAR_FILE"
+ #TODO #mvn nexus:staging-close
+ #TODO #mvn nexus:staging-promote
+else
+ echo "Skipping Maven deployment and Git push because we are not on Hudson."
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.