Define deployment modes to be able to deploy in diferent ways (classes or war)
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 17 Nov 2008 07:47:34 +0000
changeset 1977 ea57287e97c9
parent 1976 25f0108dd29d
child 1978 cda8c2434bf5
Define deployment modes to be able to deploy in diferent ways (classes or war)
build.xml
config/Openbravo.properties.template
--- a/build.xml	Sun Nov 16 23:12:11 2008 +0000
+++ b/build.xml	Mon Nov 17 07:47:34 2008 +0000
@@ -100,6 +100,14 @@
 	<property name="obx.export.DB" value="false"/>
 	<property name="obx.export.CS" value="false"/>
 	
+	<condition property="mode.war">
+	  <equals arg1="war" arg2="${deploy.mode}"/>
+	</condition>
+	
+	 <condition property="mode.class">
+	    <equals arg1="class" arg2="${deploy.mode}"/>
+	  </condition>
+		
 	<condition property="apply.modules.on.create">
 		<or>
 		  <equals arg1="yes" arg2="${apply.on.create}"/>
@@ -199,14 +207,34 @@
   <target name="compile" depends="init">
     <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true"/>
   </target>
-
-  <target name="compile.complete.development" depends="init">
+	
+	<target name="compile.complete.deploy">
+	  <antcall target="compile.complete.development"/>
+	  <antcall target="compile.complete.war"/>
+	</target>
+	
+  <target name="compile.complete.development" depends="init" if="mode.class">
     <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
   </target>
+	
+	<target name="compile.complete.war" depends="init" if="mode.war">
+	  <antcall target="compile.complete"/>
+		<antcall target="war"/>
+	</target>
 
-  <target name="compile.development" depends="init">
+	<target name="compile.deploy">
+		<antcall target="compile.war"/>
+	  <antcall target="compile.development"/>
+	</target>
+	
+  <target name="compile.development" depends="init" if="mode.class">
     <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true"/>
   </target>
+	
+	<target name="compile.war" if="mode.war">
+		<antcall target="compile"/>
+		<antcall target="war"/>
+	</target>
 
   <target name="compile.web" depends="init">
     <ant dir="${base.src}" target="compile.web" inheritAll="true" inheritRefs="true"/>
@@ -421,7 +449,7 @@
     </taskdef>
     <applyModule/>
 	</target>
-	
+		
 	<target name="apply.modules">
 	  <echo>Applying ${module} modules...</echo>
     <taskdef name="applyModule"
@@ -431,20 +459,11 @@
     <antcall target="update.database.mod"/>
     <antcall target="generate.entities"/>
     <applyModule/>
-		<antcall target="compile"/>
-		<antcall target="war"/>
+		<antcall target="compile.deploy"/>
 		<!--antcall target="deploy.context"/-->
 	</target>
-  <target name="apply.modules.development">
-    <echo>Applying ${module} modules...</echo>
-    <taskdef name="applyModule"
-             classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
-      <classpath refid="project.class.path"/>
-    </taskdef>
-    <antcall target="update.database.mod"/>
-    <applyModule/>
-    <antcall target="compile.development"/>
-  </target>
+  
+	
 	<target name="tomcat.list">
 		<taskdef name="list"  classname="org.apache.catalina.ant.ListTask">
 		  <classpath refid="tomcat.classpath"/>
--- a/config/Openbravo.properties.template	Sun Nov 16 23:12:11 2008 +0000
+++ b/config/Openbravo.properties.template	Mon Nov 17 07:47:34 2008 +0000
@@ -47,6 +47,9 @@
 # Openbravo ERP version
 application.version=2.50
 
+#Deploy mode: valid values [class, war]
+deploy.mode=class
+
 ############
 # Database #
 ############