[Bedework-commit] rpiutil r84 - in trunk: . build

svnadmin at bedework.org svnadmin at bedework.org
Thu Jun 12 00:04:45 EDT 2008


Author: douglm
Date: 2008-06-12 00:04:43 -0400 (Thu, 12 Jun 2008)
New Revision: 84

Added:
   trunk/build/getJar.xml
Modified:
   trunk/build.properties
   trunk/build.xml
Log:
First step in changing bedework build to fetch jars from an external repository.

Defined an ant macro getJar to do the job. Tried out with the rpiutil project.


Added: trunk/build/getJar.xml
===================================================================
--- trunk/build/getJar.xml	                        (rev 0)
+++ trunk/build/getJar.xml	2008-06-12 04:04:43 UTC (rev 84)
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+
+<!-- ===================================================================
+     Define a macro to fetch jars from the bedework repository or from
+     the generated library in the named project.
+
+     The project will only be used if the property org.bedework.quickstart.build
+     is defined.
+
+     @param name    Name of the jar e.g. junit
+     @param version optional version for the jar
+     @param src     optional url for the get task
+     @param lib     optional destination for the get task
+     @param project optional project name for local fetch from generated quickstart.
+     =================================================================== -->
+<project name="getJar" basedir="." default="">
+  <macrodef name="getJar">
+    <attribute name="name"/>
+    <attribute name="version" default="" />
+    <attribute name="src" default="http://bedework.org/downloads/lib"/>
+    <attribute name="lib" default="${lib.dir}"/>
+    <attribute name="project" default="" />
+    <sequential>
+      <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
+
+      <if>
+        <equals arg1="@{version}" arg2="" />
+        <then>
+          <var name="org.bedework.getjar.jarname" value="@{name}.jar" />
+        </then>
+        <else>
+          <var name="org.bedework.getjar.jarname" value="@{name}-@{version}.jar" />
+       </else>
+      </if>
+
+      <var name="org.bedework.getjar.dest"
+           value="@{lib}/${org.bedework.getjar.jarname}" />
+
+      <if>
+        <or>
+          <equals arg1="@{project}" arg2="" />
+          <not>
+            <isset property="org.bedework.quickstart.build" />
+          </not>
+        </or>
+        <then>
+          <echo message="Fetch ${org.bedework.getjar.jarname} from bedework archive" />
+          <get src="@{src}/${org.bedework.getjar.jarname}"
+               dest="${org.bedework.getjar.dest}"
+               ignoreerrors="true"
+               verbose="true"
+               usetimestamp="true"/>
+        </then>
+        <else>
+          <var name="org.bedework.getjar.project.jar"
+               value="${project.home}/../@{project}/libapi/${org.bedework.getjar.jarname}" />
+          <if>
+            <uptodate srcfile="${org.bedework.getjar.project.jar}"
+                      targetfile="${org.bedework.getjar.dest}" />
+            <then>
+              <echo message="Fetch ${org.bedework.getjar.jarname} from quickstart" />
+              <copy file="${org.bedework.getjar.project.jar}"
+                    todir="@{lib}" overwrite="yes" />
+            </then>
+          </if>
+       </else>
+      </if>
+    </sequential>
+  </macrodef>
+</project>


Property changes on: trunk/build/getJar.xml
___________________________________________________________________
Name: svn:eol-style
   + LF

Modified: trunk/build.properties
===================================================================
--- trunk/build.properties	2008-06-02 19:01:08 UTC (rev 83)
+++ trunk/build.properties	2008-06-12 04:04:43 UTC (rev 84)
@@ -6,7 +6,7 @@
 edu.rpi.cmt.package.name=RPI utility package
 
 # Version we are building
-edu.rpi.cmt.version=3.2
+edu.rpi.cmt.version=3.5
 
 # Name of generated jar file
 edu.rpi.cmt.rpiutil.jar=rpiutil

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2008-06-02 19:01:08 UTC (rev 83)
+++ trunk/build.xml	2008-06-12 04:04:43 UTC (rev 84)
@@ -11,22 +11,37 @@
 <project name="rpiutil" default="build">
   <property environment="env"/>
   <property name="base.name" value="rpiutil"/>
-  <dirname property="this.dir" file="${ant.file}"/>
+  <dirname property="project.home" file="${ant.file}"/>
 
-  <property file="${this.dir}/build.properties" />
+  <property file="${project.home}/build.properties" />
+  <property name="build.dir" location="${project.home}/build"/>
 
-  <property name="source.home" location="${this.dir}/src"/>
-  <property name="dist.home" location="${this.dir}/dist"/>
-  <property name="lib.dir" location="${this.dir}/lib"/>
-  <property name="libapi.dir" location="${this.dir}/libapi"/>
+  <import file="${build.dir}/getJar.xml"/>
 
-  <property name="build.dir" location="${this.dir}/build"/>
+  <property name="source.home" location="${project.home}/src"/>
+  <property name="dist.home" location="${project.home}/dist"/>
+  <property name="lib.dir" location="${project.home}/lib"/>
+  <property name="libapi.dir" location="${project.home}/libapi"/>
+
+  <property name="build.dir" location="${project.home}/build"/>
   <property name="buildjar" location="${build.dir}/buildjar.xml"/>
 
   <property name="project.name" value="${edu.rpi.cmt.package.name}"/>
-  <property name="project.version" value="${edu.rpi.cmt.version}"/>
+  <property name="project.version" value="${edu.rpi.cmt.version}"/>
 
   <target name="init">
+    <mkdir dir="${lib.dir}" />
+
+    <getJar name="avalon" />
+    <getJar name="fop" />
+    <getJar name="jtidy" />
+    <getJar name="junit" version="4.4" />
+    <getJar name="log4j" version="1.2.8" />
+    <getJar name="lucene-core" version="2.0.0" />
+    <getJar name="lucene-misc" version="2.0.0" />
+    <getJar name="servletapi" version="2.4" />
+    <getJar name="struts" version="1.2.9" />
+
     <mkdir dir="${dist.home}" />
 
     <property name="test.data.dir"



More information about the Bedework-commit mailing list