Basic builds more or less working
authormbaudier <mbaudier@argeo.org>
Mon, 22 Apr 2013 13:25:37 +0000 (15:25 +0200)
committermbaudier <mbaudier@argeo.org>
Mon, 22 Apr 2013 13:25:37 +0000 (15:25 +0200)
bin/argeo-builder
specs/bootstrap/ant/build.sh [new file with mode: 0755]
specs/bootstrap/ant/org.apache.ant-skipTestJars.patch [new file with mode: 0644]
specs/org.argeo.tp/biz.aQute.bnd/build.sh [new file with mode: 0755]
specs/org.argeo.tp/org.eclipse.jdt.core.compiler.batch/build.sh

index 12e818ad8a3d171c7692fbd8182820b4916967ec..b1ba627bb97ec069b7900ddcb39b4e01cc329a5d 100644 (file)
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+if [ -z "$JAVA_HOME" ]; then
+       export JAVA_HOME=/usr/lib/jvm/java-1.6.0
+fi  
+JAVA=$JAVA_HOME/bin/java
+
 function argeo_builder_variables() {
        export ARTIFACT_DIR=$1
        export ARTIFACT=${ARTIFACT_DIR##*/}
@@ -7,13 +12,38 @@ function argeo_builder_variables() {
        export GROUP=${GROUP_DIR##*/}
        export SOURCE_DIR=${ARTIFACT_DIR/specs/sources}
        export BUILD_DIR=${ARTIFACT_DIR/specs/build}
+       export ROOT_DIR=`cd $ARTIFACT_DIR/../../.. && pwd`
+       export CACHE_BASE=$ROOT_DIR/cache
+       CACHE_DIR=${GROUP_DIR/specs/cache}
 }
 
 function argeo_builder_download_eclipse() {
-       ECLIPSE_MIRROR=http://ftp.halifax.rwth-aachen.de/eclipse
-       ECLIPSE_FILE=$1
-       ECLIPSE_URL=$ECLIPSE_MIRROR$ECLIPSE_FILE
+       MIRROR=http://ftp.halifax.rwth-aachen.de/eclipse
+       FILE=$1
+       URL=$MIRROR$FILE
        mkdir -p $SOURCE_DIR
-       (cd $SOURCE_DIR && wget --timestamping $ECLIPSE_URL)
+       (cd $SOURCE_DIR && wget --timestamping $URL)
+}
+
+function argeo_builder_download_apache() {
+       MIRROR=http://apache.openmirror.de
+       FILE=$1
+       URL=$MIRROR$FILE
+       mkdir -p $SOURCE_DIR
+       (cd $SOURCE_DIR && wget --timestamping $URL)
+}
+
+function run_ant() {
+       $JAVA -jar $CACHE_BASE/bootstrap/ant-launcher.jar $1
+}
+
+function push_to_cache() {
+       mkdir -p $CACHE_DIR
+       cp -v $1 $CACHE_DIR
+}
+
+function reset_dir() {
+       rm -rf $1
+       mkdir -p $1
 }
 
diff --git a/specs/bootstrap/ant/build.sh b/specs/bootstrap/ant/build.sh
new file mode 100755 (executable)
index 0000000..771016f
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+source ../../../bin/argeo-builder
+argeo_builder_variables $PWD
+
+VERSION=1.8.4
+
+SOURCE_FILE=/ant/source/apache-ant-$VERSION-src.tar.gz
+SOURCE_FILENAME=${SOURCE_FILE##*/}
+SRC_DIR=$BUILD_DIR/src
+CLASSES_DIR=$BUILD_DIR/classes
+
+echo Download sources
+argeo_builder_download_apache $SOURCE_FILE
+
+echo Untar sources
+reset_dir $BUILD_DIR
+(cd $BUILD_DIR && tar -xzf $SOURCE_DIR/$SOURCE_FILENAME)
+mv $BUILD_DIR/apache-ant-* $BUILD_DIR/apache-ant
+
+echo Patch
+(cd $BUILD_DIR/apache-ant && patch < $ARTIFACT_DIR/org.apache.ant-skipTestJars.patch)
+
+echo Build bootstrap
+(cd $BUILD_DIR/apache-ant && sh build.sh jars)
+
+push_to_cache $BUILD_DIR/apache-ant/build/lib/ant.jar
+push_to_cache $BUILD_DIR/apache-ant/build/lib/ant-launcher.jar
diff --git a/specs/bootstrap/ant/org.apache.ant-skipTestJars.patch b/specs/bootstrap/ant/org.apache.ant-skipTestJars.patch
new file mode 100644 (file)
index 0000000..5d16574
--- /dev/null
@@ -0,0 +1,12 @@
+--- build.xml.orig     2012-05-22 06:25:21.000000000 +0200
++++ build.xml  2013-01-30 07:36:35.990006411 +0100
+@@ -884,7 +884,7 @@
+        ===================================================================
+   -->
+   <target name="dist-lite"
+-    depends="jars,test-jar"
++    depends="jars"
+     description="--> creates a minimum distribution to run Apache Ant">
+     <mkdir dir="${dist.dir}"/>
+
diff --git a/specs/org.argeo.tp/biz.aQute.bnd/build.sh b/specs/org.argeo.tp/biz.aQute.bnd/build.sh
new file mode 100755 (executable)
index 0000000..39a01a7
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+source ../../../bin/argeo-builder
+argeo_builder_variables $PWD
+
+VERSION=2.0.0
+
+echo Checkout
+[ -d $SOURCE_DIR ] && echo git pull || mkdir -p $SOURCE_DIR; (cd $SOURCE_DIR && git clone git://github.com/bndtools/bnd.git .);
+#mkdir -p $SOURCE_DIR
+
+
+echo Build
+reset_dir $BUILD_DIR
+(cd $BUILD_DIR && git clone file://$SOURCE_DIR .)
+(cd $BUILD_DIR && run_ant dist)
+
+push_to_cache $BUILD_DIR/dist/bundles/biz.aQute.bnd/biz.aQute.bnd-$VERSION.jar
+push_to_cache $BUILD_DIR/dist/bundles/biz.aQute.bndlib/biz.aQute.bndlib-$VERSION.jar
+
index 28c4abcde875393274a0f3bf34550ed4cd54efc7..de70d08e5a162c2b6e4d031da77fe39096238d88 100755 (executable)
@@ -11,24 +11,20 @@ CLASSES_DIR=$BUILD_DIR/classes
 BUNDLE_VERSION=3.8.2
 
 # TODO make javac choice more configurable 
-JAVAC=javac
-JAR=jar
+JAVAC=$JAVA_HOME/bin/javac
+JAR=$JAVA_HOME/bin/jar
 
-JAVAC_OPTS="-nowarn -source 1.6 -target 1.6"
+JAVAC_OPTS="-nowarn -source 1.6 -target 1.6 -classpath $CACHE_BASE/bootstrap/ant.jar"
 
 echo Download sources
 argeo_builder_download_eclipse $SOURCE_FILE
 
 echo Unjar sources
-rm -rf $SRC_DIR
-mkdir -p $SRC_DIR
-(cd $SRC_DIR && $JAR -xf $SOURCE_DIR/$SOURCE_FILENAME)
-# Remove Ant dependant file
-rm  $SRC_DIR/org/eclipse/jdt/core/JDTCompilerAdapter.java
+reset_dir $SRC_DIR
+(cd $SRC_DIR && $JAR -xvf $SOURCE_DIR/$SOURCE_FILENAME)
 
 echo Compile
-rm -rf $CLASSES_DIR
-mkdir -p $CLASSES_DIR
+reset_dir $CLASSES_DIR
 $JAVAC $JAVAC_OPTS -d $CLASSES_DIR $(find $SRC_DIR/org/* | grep .java) 2>&1 | tee $BUILD_DIR/build.log
 
 echo Copy additional files