[Bedework-commit] caldavTest r97 - in trunk: . build

svnadmin at bedework.org svnadmin at bedework.org
Fri Nov 7 11:21:55 EST 2008


Author: douglm
Date: 2008-11-07 11:21:55 -0500 (Fri, 07 Nov 2008)
New Revision: 97

Modified:
   trunk/build.xml
   trunk/build/buildjar.xml
   trunk/build/getJar.xml
Log:
Set things up so we use a common cache for all quickstart jars

Modified: trunk/build/buildjar.xml
===================================================================
--- trunk/build/buildjar.xml	2008-10-07 21:38:47 UTC (rev 96)
+++ trunk/build/buildjar.xml	2008-11-07 16:21:55 UTC (rev 97)
@@ -36,6 +36,8 @@
 -->
 
 <project name="buildjar" default="build" >
+  <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
+
   <target name="init">
     <!--  =================== Compilation Control Options ===============
       These properties control option settings on the Javac compiler when it
@@ -79,71 +81,75 @@
       -->
     </uptodate>
 
-    <antcall target="do.build.uptodate" inheritRefs="true" />
-    <antcall target="do.build.notuptodate" inheritRefs="true" />
-  </target>
+    <if>
+      <isset property="build.jar.uptodate"/>
+      <then>
+        <echo message="**** ${build.jar.file} is up to date" />
+      </then>
+    </if>
 
-  <target name="do.build.notuptodate"
-          if="build.jar.uptodate">
-    <echo message="**** ${build.jar.file} is up to date" />
-  </target>
+    <if>
+      <not>
+        <isset property="build.jar.uptodate"/>
+      </not>
+      <then>
+        <echo message="**** ${build.jar.file} needs rebuilding" />
 
-  <target name="do.build.uptodate"
-          unless="build.jar.uptodate">
-    <echo message="**** ${build.jar.file} needs rebuilding" />
+        <!-- Delete jar file -->
+        <delete file="${build.jar.file}"/>
 
-    <!-- Delete jar file -->
-    <delete file="${build.jar.file}"/>
+        <dirname property="build.jar.dir" file="${build.jar.file}"/>
 
-    <dirname property="build.jar.dir" file="${build.jar.file}"/>
+        <mkdir dir="${build.jar.dir}" />
 
-    <mkdir dir="${build.jar.dir}" />
+        <!-- ==========================================================
+                          Build the classes
+             ========================================================== -->
 
-    <!-- ==============================================================
-                      Build the classes
-         ============================================================== -->
+        <!-- First copy the sources we are going to compile into a temp
+             directory. -->
+        <mkdir dir="${jar.temp.sources}" />
+        <copy toDir="${jar.temp.sources}">
+          <fileset refid="base.java.sources" />
+          <fileset refid="base.generated.java.sources" />
+          <fileset refid="base.resource.files"/>
+        </copy>
 
-    <!-- First copy the sources we are going to compile into a temp
-         directory. -->
-    <mkdir dir="${jar.temp.sources}" />
-    <copy toDir="${jar.temp.sources}">
-      <fileset refid="base.java.sources" />
-      <fileset refid="base.resource.files"/>
-    </copy>
+        <mkdir dir="${jar.temp.classes}"/>
+        <echo message="About to build jar ${build.jar.file}"/>
+        <property name="cp" refid="compile.classpath" />
+        <echo message="***************cp: ${cp}"/>
 
-    <mkdir dir="${jar.temp.classes}"/>
-    <echo message="About to build jar ${build.jar.file}"/>
-    <property name="cp" refid="compile.classpath" />
-    <echo message="***************cp: ${cp}"/>
+        <javac srcdir="${jar.temp.sources}"
+               destdir="${jar.temp.classes}"
+               debug="${compile.debug}"
+               verbose="${compile.verbose}"
+               listfiles="${compile.listfiles}"
+               deprecation="${compile.deprecation}"
+               optimize="${compile.optimize}">
+          <classpath refid="compile.classpath"/>
+          <include name="**/*.java"/>
+          <compilerarg value="-nowarn" compiler="jikes" />
+        </javac>
 
-    <javac srcdir="${jar.temp.sources}"
-           destdir="${jar.temp.classes}"
-           debug="${compile.debug}"
-           verbose="${compile.verbose}"
-           listfiles="${compile.listfiles}"
-           deprecation="${compile.deprecation}"
-           optimize="${compile.optimize}">
-      <classpath refid="compile.classpath"/>
-      <include name="**/*.java"/>
-      <compilerarg value="-nowarn" compiler="jikes" />
-    </javac>
+        <!-- ==========================================================
+                          Build jar file
+             ========================================================== -->
 
-    <!-- ==============================================================
-                      Build jar file
-         ============================================================== -->
+        <jar jarfile="${build.jar.file}">
+          <fileset dir="${jar.temp.classes}">
+            <patternset refid="base.class.patternset"/>
+          </fileset>
+          <fileset refid="base.resource.files"/>
+        </jar>
 
-    <jar jarfile="${build.jar.file}">
-      <fileset dir="${jar.temp.classes}">
-        <patternset refid="base.class.patternset"/>
-      </fileset>
-      <fileset refid="base.resource.files"/>
-    </jar>
+        <!-- ==========================================================
+                          Clean up
+             ========================================================== -->
 
-    <!-- ==============================================================
-                      Clean up
-         ============================================================== -->
-
-    <delete dir="${jar.temp.sources}" />
-    <delete dir="${jar.temp.classes}"/>
+        <delete dir="${jar.temp.sources}" />
+        <delete dir="${jar.temp.classes}"/>
+      </then>
+    </if>
   </target>
 </project>

Modified: trunk/build/getJar.xml
===================================================================
--- trunk/build/getJar.xml	2008-10-07 21:38:47 UTC (rev 96)
+++ trunk/build/getJar.xml	2008-11-07 16:21:55 UTC (rev 97)
@@ -18,6 +18,7 @@
      @param src      optional url for the get task
      @param lib      optional destination for the get task
      @param libcache optional location of the cache
+     @param property optional name of property to hold location of resulting jar
      @param project optional project name for local fetch from generated quickstart.
      =================================================================== -->
 <project name="getJar" basedir="." default="">
@@ -26,7 +27,8 @@
     <attribute name="version" default="" />
     <attribute name="src" default="http://bedework.org/downloads/lib"/>
     <attribute name="lib" default="${lib.dir}"/>
-    <attribute name="libcache" default="@{lib}/../libcache"/>
+    <attribute name="libcache" default="${org.bedework.libcache.dir}"/>
+    <attribute name="property" default="" />
     <attribute name="project" default="" />
     <attribute name="projectHome" default="" />
     <sequential>
@@ -68,12 +70,18 @@
 
       <var name="org.bedework.getjar.finished" value="false" />
 
-      <!-- If a project was specified try to get it from the locale file system
+      <!-- If a project or projecthome was specified try to get it from the
+           local file system
         -->
       <if>
-        <not>
-          <equals arg1="@{project}" arg2="" />
-        </not>
+        <or>
+          <not>
+            <equals arg1="@{project}" arg2="" />
+          </not>
+          <not>
+            <equals arg1="@{projecthome}" arg2="" />
+          </not>
+        </or>
         <then>
           <var name="org.bedework.getjar.project.jar"
                value="${org.bedework.getjar.projecthome}/dist/${org.bedework.getjar.jarname}" />
@@ -115,6 +123,29 @@
                 todir="@{lib}" overwrite="yes" />
         </then>
       </if>
+
+      <if>
+        <not>
+          <equals arg1="@{property}" arg2="" />
+        </not>
+        <then>
+          <echo message="set property @{property} to ${org.bedework.getjar.dest}" />
+          <property name="@{property}" location="${org.bedework.getjar.dest}" />
+        </then>
+        <elseif>
+          <isset property="org.bedework.getjar.property.prefix" />
+          <then>
+            <echo message="set property ${org.bedework.getjar.property.prefix}.@{name} to ${org.bedework.getjar.dest}" />
+            <property name="${org.bedework.getjar.property.prefix}.@{name}"
+                      location="${org.bedework.getjar.dest}" />
+          </then>
+        </elseif>
+        <else>
+          <echo message="set property org.bedework.getjar.jarloc.@{name} to ${org.bedework.getjar.dest}" />
+          <property name="org.bedework.getjar.jarloc.@{name}"
+                    location="${org.bedework.getjar.dest}" />
+        </else>
+      </if>
     </sequential>
   </macrodef>
 </project>

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2008-10-07 21:38:47 UTC (rev 96)
+++ trunk/build.xml	2008-11-07 16:21:55 UTC (rev 97)
@@ -25,6 +25,9 @@
   <property name="project.name" value="${org.bedework.package.name}"/>
   <property name="project.version" value="${org.bedework.version}"/>
 
+  <property name="org.bedework.libcache.dir"
+            location="${project.home}/libcache"/>
+
   <import file="${build.dir}/getJar.xml"/>
 
   <!-- =================================================================



More information about the Bedework-commit mailing list