build.xml
changeset 124 e202022fd2fd
parent 98 8e1fa3bfbf21
child 125 471aee945a8f
--- a/build.xml	Mon Nov 26 16:34:44 2007 +0000
+++ b/build.xml	Mon Nov 26 18:16:21 2007 +0000
@@ -74,6 +74,12 @@
         </and>
   </condition>
 
+  <condition property="no.java.home" value="true">
+    <not>
+      <isset property="${env.JAVA_HOME}"/>
+    </not>
+  </condition>
+
   <path id="project.class.path">
     <pathelement path="${build}"/>
     <fileset dir="${base.lib}">
@@ -90,113 +96,117 @@
     </fileset>
   </path>
 
-  <target name="compile.complete">
+  <target name="init">
+    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
+  </target>
+
+  <target name="compile.complete" depends="init">
     <ant dir="${base.subversion}/src" target="compile.complete" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="compile">
+  <target name="compile" depends="init">
     <ant dir="${base.subversion}/src" target="compile" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="compile.complete.development">
+  <target name="compile.complete.development" depends="init">
     <ant dir="${base.subversion}/src" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="compile.development">
+  <target name="compile.development" depends="init">
     <ant dir="${base.subversion}/src" target="compile.development" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="eclipse.compile">
+  <target name="eclipse.compile" depends="init">
     <ant dir="${base.subversion}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="eclipse.compile.complete">
+  <target name="eclipse.compile.complete" depends="init">
     <ant dir="${base.subversion}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/src" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="compile.src">
+  <target name="compile.src" depends="init">
     <ant dir="${base.subversion}/src" target="compile.src" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="war">
+  <target name="war" depends="init">
     <ant dir="${base.subversion}${separator}src" target="build.war" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="core.docs">
+  <target name="core.docs" depends="init">
     <ant dir="${base.subversion}${separator}src-core" target="doc" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="core.lib">
+  <target name="core.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-core" target="build" inheritAll="true" inheritRefs="true"/>
     <copy file="${base.subversion}/src-core/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
   </target>
   
-  <target name="eclipse.wad.lib">
+  <target name="eclipse.wad.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-wad" target="sqlc" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="wad.docs">
+  <target name="wad.docs" depends="init">
     <ant dir="${base.subversion}${separator}src-wad" target="doc" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="wad.lib">
+  <target name="wad.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-wad" target="build" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="eclipse.trl.lib">
+  <target name="eclipse.trl.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-trl" target="sqlc" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="trl.docs">
+  <target name="trl.docs" depends="init">
     <ant dir="${base.subversion}${separator}src-trl" target="doc" inheritAll="true" inheritRefs="true"/>
   </target>
   
-  <target name="trl.lib">
+  <target name="trl.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-trl" target="build" inheritAll="true" inheritRefs="true"/>
     <!--copy file="${base.subversion}/src-trl/lib/openbravo-trl.jar" todir="${base.lib}" overwrite="true" failonerror="false"/-->
   </target>
   
-  <target name="database.lib">
+  <target name="database.lib" depends="init">
     <ant dir="${base.subversion}${separator}src-db" target="jar" inheritAll="true" inheritRefs="true"/>
     <copy file="${base.subversion}/src-db/build/lib/dbmanager.jar" todir="${base.subversion}/database/lib" overwrite="true" failonerror="false"/>
   </target>
 
-  <target name="installWebService">
+  <target name="installWebService" depends="init">
     <ant dir="${base.subversion}/src" target="installWebService" inheritAll="true" inheritRefs="true">
       <property name="wsdd" value="1"/>
     </ant>
   </target>
 
-  <target name="uninstallWebService">
+  <target name="uninstallWebService" depends="init">
     <ant dir="${base.subversin}/src" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="preinstall">
+  <target name="preinstall" depends="init">
     <ant dir="${base.subversion}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/bdutil" target="preinstall" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="preinstall.complete">
+  <target name="preinstall.complete" depends="init">
     <ant dir="${base.subversion}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/bdutil" target="preinstall_complete" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="install">
+  <target name="install" depends="init">
     <ant dir="${base.subversion}/install" target="build" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.subversion}/install" target="install" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="deploy">
+  <target name="deploy" depends="init">
     <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
   </target>
 
-  <target name="install.source">
+  <target name="install.source" depends="init">
     <antcall target="database.lib"/>
   	<ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
     <antcall target="core.lib"/>
@@ -207,7 +217,7 @@
     <antcall target="war"/>
   </target>
   
-  <target name="eclipse.install.source">
+  <target name="eclipse.install.source" depends="init">
 	<antcall target="database.lib"/>
     <ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
     <antcall target="core.lib"/>
@@ -217,52 +227,52 @@
     <antcall target="installWebService"/>
   </target>
 
-    <target name="create.database">
+    <target name="create.database" depends="init">
     	<antcall target="database.lib"/>
     	<ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="update.database">
+    <target name="update.database" depends="init">
         <ant dir="${base.subversion}/database" target="update.database" inheritAll="true" inheritRefs="true"/>   
    </target>
 
-    <target name="create.database.structure">
+    <target name="create.database.structure" depends="init">
         <ant dir="${base.subversion}/database" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="update.database.structure">
+    <target name="update.database.structure" depends="init">
         <ant dir="${base.subversion}/database" target="update.database.structure" inheritAll="true" inheritRefs="true"/>   
    </target>
 
-    <target name="create.database.script">
+    <target name="create.database.script" depends="init">
         <ant dir="${base.subversion}/database" target="create.database.script" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="update.database.script">
+    <target name="update.database.script" depends="init">
         <ant dir="${base.subversion}/database" target="update.database.script" inheritAll="true" inheritRefs="true"/>   
    </target>
 
-    <target name="export.database.structure">
+    <target name="export.database.structure" depends="init">
         <ant dir="${base.subversion}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
     </target>
     
-    <target name="export.database.data">
+    <target name="export.database.data" depends="init">
         <ant dir="${base.subversion}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
     </target>
     
-    <target name="import.database.data">
+    <target name="import.database.data" depends="init">
         <ant dir="${base.subversion}/database" target="import.database.data" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="export.database.sampledata">
+    <target name="export.database.sampledata" depends="init">
         <ant dir="${base.subversion}/database" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="import.database.sampledata">
+    <target name="import.database.sampledata" depends="init">
         <ant dir="${base.subversion}/database" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
     </target>
 
-    <target name="save.database.model">
+    <target name="save.database.model" depends="init">
         <ant dir="${base.subversion}/database" target="save.database.model" inheritAll="true" inheritRefs="true"/>
     </target>