build.xml
changeset 14874 6bff3ff6bff1
parent 14873 4131eb5bea35
child 14875 61149227461b
equal deleted inserted replaced
14873:4131eb5bea35 14874:6bff3ff6bff1
    93   <property name="force" value="false" />
    93   <property name="force" value="false" />
    94   <property name="strict.template.application" value="false" />
    94   <property name="strict.template.application" value="false" />
    95   <property name="rd" value="false" />
    95   <property name="rd" value="false" />
    96   <property name="local" value="true" />
    96   <property name="local" value="true" />
    97   <property name="apply.modules.complete.compilation" value="false" />
    97   <property name="apply.modules.complete.compilation" value="false" />
    98   <property name="calculate.core.revision" value="true" />
    98   <property name="calculate.core.revision" value="true"/>
    99   <property name="stopOnWadError" value="false" />
    99   <property name="stopOnWadError" value="false"/>
   100   <property name="friendlyWarnings" value="false" />
   100   <property name="friendlyWarnings" value="false"/>
   101   <property name="checkTranslationConsistency" value="true" />
   101   <property name="checkTranslationConsistency" value="true"/>
   102   <property name="buildValidation" value="true" />
   102   <property name="buildValidation" value="true"/>
   103   <property name="disableCheckReferencedOrganizations" value="false" />
   103   <property name="disableCheckReferencedOrganizations" value="true"/>
   104 
   104 
   105   <available file=".hg" property="is.hg" />
   105   <available file=".hg" property="is.hg" />
   106 
   106 
   107   <condition property="calculate.core.rev">
   107   <condition property="calculate.core.rev">
   108     <istrue value="${calculate.core.revision}" />
   108    <istrue value="${calculate.core.revision}"/>
   109   </condition>
   109   </condition>
   110 
   110   
   111   <condition property="xml.core.rev">
   111   <condition property="xml.core.rev">
   112     <isfalse value="${calculate.core.revision}" />
   112      <isfalse value="${calculate.core.revision}"/>
   113   </condition>
   113   </condition>
   114 
   114   
   115   <condition property="deploy.mode" value="class">
   115   <condition property="deploy.mode" value="class">
   116     <not>
   116     <not>
   117       <isset property="${deploy.mode}" />
   117       <isset property="${deploy.mode}" />
   118     </not>
   118     </not>
   119   </condition>
   119   </condition>
   278     </fileset>
   278     </fileset>
   279     <fileset dir="${base.modules}">
   279     <fileset dir="${base.modules}">
   280       <include name="*/lib/**" />
   280       <include name="*/lib/**" />
   281     </fileset>
   281     </fileset>
   282   </path>
   282   </path>
   283 
   283   
   284   <!-- This classpath is needed only for the apply.module task-->
   284   <!-- This classpath is needed only for the apply.module task-->
   285   <path id="apply.module.runtime.classpath">
   285   <path id="apply.module.runtime.classpath">
   286     <dirset dir="${base.modules}">
   286     <dirset dir="${base.modules}">
   287       <include name="*/build/classes/" />
   287       <include name="*/build/classes/" />
   288     </dirset>
   288     </dirset>
   310     </fileset>
   310     </fileset>
   311     <fileset dir="${base.modules}">
   311     <fileset dir="${base.modules}">
   312       <include name="*/lib/**" />
   312       <include name="*/lib/**" />
   313     </fileset>
   313     </fileset>
   314   </path>
   314   </path>
   315 
   315   
   316   <macrodef name="updatesystemstatus">
   316   <macrodef name="updatesystemstatus">
   317     <attribute name="v" default="NOT SET" />
   317      <attribute name="v" default="NOT SET"/>
   318     <sequential>
   318      <sequential>
   319       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
   319        <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
   320         <classpath>
   320          <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
   321           <fileset dir="${base.lib}">
   321          <transaction> UPDATE ad_system_info SET system_status='@{v}' ;
   322             <include name="**/*.jar">
       
   323             </include>
       
   324           </fileset>
       
   325         </classpath>
       
   326         <transaction> UPDATE ad_system_info SET system_status='@{v}' ;
       
   327                        DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
   322                        DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
   328          </transaction>
   323          </transaction>
   329       </sql>
   324        </sql>
   330     </sequential>
   325      </sequential>
   331   </macrodef>
   326   </macrodef>
   332 
   327   
   333   <taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
   328   <taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
   334 
   329   
   335   <target name="init" depends="code.rev">
   330   <target name="init" depends="code.rev">
   336     <fail if="root.user" message="Don't run ant tasks with the root user" />
   331     <fail if="root.user" message="Don't run ant tasks with the root user" />
   337     <fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
   332     <fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
   338   </target>
   333   </target>
   339 
   334 
   343     </condition>
   338     </condition>
   344   </target>
   339   </target>
   345 
   340 
   346   <target name="set.code.rev" if="is.hg">
   341   <target name="set.code.rev" if="is.hg">
   347     <exec executable="hg" outputproperty="hg.id" failifexecutionfails="false">
   342     <exec executable="hg" outputproperty="hg.id" failifexecutionfails="false">
   348       <arg value="id" />
   343       <arg value="id"/>
   349       <arg value="-i" />
   344       <arg value="-i"/>
   350     </exec>
   345     </exec>
   351   </target>
   346   </target>
   352 
   347 
   353   <target name="compile.complete" depends="init">
   348   <target name="compile.complete" depends="init">
   354     <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
   349     <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
   356 
   351 
   357   <target name="smartbuild" depends="init">
   352   <target name="smartbuild" depends="init">
   358     <property name="smart.mode" value="true" />
   353     <property name="smart.mode" value="true" />
   359     <property name="onlyIfModified" value="true" />
   354     <property name="onlyIfModified" value="true" />
   360     <antcall target="core.lib" />
   355     <antcall target="core.lib" />
   361 
   356     
   362     <condition property="no.local">
   357     <condition property="no.local">
   363       <not>
   358       <not>
   364         <istrue value="${local}" />
   359         <istrue value="${local}" />
   365       </not>
   360       </not>
   366     </condition>
   361     </condition>
   367     <antcall target="update.database.if.no.local" />
   362     <antcall target="update.database.if.no.local" />
   368 
   363     
   369     <antcall target="wad.lib" />
   364     <antcall target="wad.lib" />
   370 
   365     
   371     <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
   366     <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
   372       <classpath refid="project.class.path" />
   367       <classpath refid="project.class.path" />
   373     </taskdef>
   368     </taskdef>
   374 
   369     
   375     <CheckSumCondition obDir="${basedir}" type="md5.wad" property="test.md5.wad" />
   370     <CheckSumCondition obDir="${basedir}"
       
   371                        type="md5.wad"
       
   372                        property="test.md5.wad"/>
   376 
   373 
   377     <condition property="new.wad">
   374     <condition property="new.wad">
   378       <istrue value="${test.md5.wad}" />
   375         <istrue value="${test.md5.wad}"/>
   379     </condition>
   376     </condition>
   380 
   377 
   381     <antcall target="trl.lib" />
   378     <antcall target="trl.lib" />
   382 
   379     
   383     <antcall inheritall="true" inheritrefs="true" target="generate.entities.quick" />
   380     <antcall inheritall="true" inheritrefs="true" target="generate.entities.quick" />
   384 
   381 
   385     <ant dir="${base.src}" target="smartbuild" inheritAll="true" inheritRefs="true" />
   382     <ant dir="${base.src}" target="smartbuild" inheritAll="true" inheritRefs="true" />
   386 
   383 
   387     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   384     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   388     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   385     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   389     <antcall target="build.deploy" />
   386     <antcall target="build.deploy" />
   390     <updatesystemstatus v="RB51" />
   387     <updatesystemstatus v="RB51"/>
   391     <!-- only restart tomcat if the restart prop was set to true -->
   388     <!-- only restart tomcat if the restart prop was set to true -->
   392     <condition property="dorestart">
   389     <condition property="dorestart">
   393       <istrue value="${restart}" />
   390       <istrue value="${restart}" />
   394     </condition>
   391     </condition>
   395     <antcall target="if.restart.tomcat" />
   392     <antcall target="if.restart.tomcat" />
   428   <target name="compile" depends="init">
   425   <target name="compile" depends="init">
   429     <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
   426     <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
   430   </target>
   427   </target>
   431 
   428 
   432   <target name="buildvalidation" depends="init, core.lib">
   429   <target name="buildvalidation" depends="init, core.lib">
   433     <updatesystemstatus v="RB11" />
   430     <updatesystemstatus v="RB11"/> 
   434     <condition property="buildValidation.var">
   431     <condition property="buildValidation.var">
   435       <istrue value="${buildValidation}" />
   432       <istrue value="${buildValidation}"  />
   436     </condition>
   433     </condition>
   437     <ant dir="src-util/buildvalidation" target="buildvalidation" inheritAll="true" inheritRefs="true" />
   434     <ant dir="src-util/buildvalidation" target="buildvalidation" inheritAll="true" inheritRefs="true" />
   438   </target>
   435   </target>
   439 
   436   
   440   <target name="compile.buildvalidation" depends="init, core.lib">
   437   <target name="compile.buildvalidation" depends="init, core.lib">
   441     <ant dir="src-util/buildvalidation" target="compile" inheritAll="true" inheritRefs="true" />
   438     <ant dir="src-util/buildvalidation" target="compile" inheritAll="true" inheritRefs="true" />
   442   </target>
   439   </target>
   443 
   440   
   444   <target name="compile.modulescript" depends="init, core.lib">
   441   <target name="compile.modulescript" depends="init, core.lib">
   445     <ant dir="src-util/modulescript" target="compile" inheritAll="true" inheritRefs="true" />
   442     <ant dir="src-util/modulescript" target="compile" inheritAll="true" inheritRefs="true" />
   446   </target>
   443   </target>
   447 
   444 
   448   <target name="compile.complete.deploy" depends="compile.complete.development, compile.complete.war">
   445   <target name="compile.complete.deploy" depends="compile.complete.development, compile.complete.war">
   449 
   446 
   450     <!-- Calculate wad checksum to enable smartbuild-->
   447     <!-- Calculate wad checksum to enable smartbuild-->
   451     <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
   448     <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
   452       <classpath refid="project.class.path" />
   449       <classpath refid="project.class.path" />
   453     </taskdef>
   450     </taskdef>
   454 
   451     
   455     <CheckSumCondition obDir="${basedir}" type="md5.wad" property="test.md5.wad" />
   452     <CheckSumCondition obDir="${basedir}"
       
   453                            type="md5.wad"
       
   454                            property="test.md5.wad"/>
   456   </target>
   455   </target>
   457 
   456 
   458   <target name="compile.complete.development" depends="init" unless="mode.war">
   457   <target name="compile.complete.development" depends="init" unless="mode.war">
   459     <updatesystemstatus v="RB43" />
   458     <updatesystemstatus v="RB43"/>
   460     <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
   459     <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
   461   </target>
   460   </target>
   462 
   461 
   463   <target name="compile.complete.war" depends="init" if="mode.war">
   462   <target name="compile.complete.war" depends="init" if="mode.war">
   464     <updatesystemstatus v="RB43" />
   463     <updatesystemstatus v="RB43"/>
   465     <antcall target="compile.complete" />
   464     <antcall target="compile.complete" />
   466     <antcall target="war" />
   465     <antcall target="war" />
   467   </target>
   466   </target>
   468 
   467 
   469   <target name="compile.deploy" depends="compile.war, compile.development">
   468   <target name="compile.deploy" depends="compile.war, compile.development">
   470     <updatesystemstatus v="RB51" />
   469     <updatesystemstatus v="RB51"/>
   471   </target>
   470   </target>
   472 
   471 
   473   <target name="compile.development" depends="init" unless="mode.war">
   472   <target name="compile.development" depends="init" unless="mode.war">
   474     <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
   473     <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
   475   </target>
   474   </target>
   524     <ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
   523     <ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
   525   </target>
   524   </target>
   526 
   525 
   527   <target name="generate.java.doc">
   526   <target name="generate.java.doc">
   528     <javadoc sourcepath="${base.src}:${base.src.test}:${build.AD}:${base.src.core}/src:${base.src.gen}:build/javasqlc/src/:build/javasqlc/srcAD" Windowtitle="${title}" access="protected" Header="${header}" Footer="${footer}" destdir="${build.docs}" linksource="no" maxmemory="1024M">
   527     <javadoc sourcepath="${base.src}:${base.src.test}:${build.AD}:${base.src.core}/src:${base.src.gen}:build/javasqlc/src/:build/javasqlc/srcAD" Windowtitle="${title}" access="protected" Header="${header}" Footer="${footer}" destdir="${build.docs}" linksource="no" maxmemory="1024M">
   529       <excludepackage name="org.openbravo.erpWindows.*" />
   528       <excludepackage name="org.openbravo.erpWindows.*"/>
   530       <classpath>
   529       <classpath>
   531         <path refid="project.class.path" />
   530         <path refid="project.class.path"/>
   532         <pathelement path="lib/build/js.jar" />
   531         <pathelement path="lib/build/js.jar" />
   533       </classpath>
   532       </classpath>
   534       <link href="http://java.sun.com/javase/6/docs/api/" />
   533       <link href="http://java.sun.com/javase/6/docs/api/"/>
   535     </javadoc>
   534     </javadoc>
   536   </target>
   535   </target>
   537 
   536 
   538   <target name="generate.entities">
   537   <target name="generate.entities">
   539     <ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
   538     <ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
   555   <target name="run.all.tests" depends="init">
   554   <target name="run.all.tests" depends="init">
   556     <ant dir="${base.src}" target="run.all.tests" inheritAll="true" inheritRefs="true" />
   555     <ant dir="${base.src}" target="run.all.tests" inheritAll="true" inheritRefs="true" />
   557   </target>
   556   </target>
   558 
   557 
   559   <target name="run.webservice.tests" depends="init">
   558   <target name="run.webservice.tests" depends="init">
   560     <ant dir="${base.src}" target="run.webservice.tests" inheritAll="true" inheritRefs="true" />
   559       <ant dir="${base.src}" target="run.webservice.tests" inheritAll="true" inheritRefs="true" />
   561   </target>
   560   </target>
   562 
   561 
   563   <target name="run.quick.tests" depends="init">
   562   <target name="run.quick.tests" depends="init">
   564     <ant dir="${base.src}" target="run.quick.tests" inheritAll="true" inheritRefs="true" />
   563     <ant dir="${base.src}" target="run.quick.tests" inheritAll="true" inheritRefs="true" />
   565   </target>
   564   </target>
   566 
   565 
   567   <target name="run.api.test.javascript">
   566   <target name="run.api.test.javascript">
   568     <ant dir="${base.src}" target="run.api.test.javascript" inheritAll="true" inheritRefs="true" />
   567     <ant dir="${base.src}" target="run.api.test.javascript" inheritAll="true" inheritRefs="true" />
   569   </target>
   568   </target>
   570 
   569   
   571   <target name="run.api.test.model" description="Checks current xml db model and dictionary API for not-allowed changes. Requires stableDBdir parameter">
   570   <target name="run.api.test.model" 
       
   571           description="Checks current xml db model and dictionary API for not-allowed changes. Requires stableDBdir parameter">
   572     <taskdef name="checkAPI" classname="org.openbravo.ddlutils.task.CheckAPIDistribution">
   572     <taskdef name="checkAPI" classname="org.openbravo.ddlutils.task.CheckAPIDistribution">
   573       <classpath refid="project.class.path" />
   573       <classpath refid="project.class.path" />
   574     </taskdef>
   574     </taskdef>
   575     <checkAPI driver="${bbdd.driver}" url="${bbdd.owner.url}" user="${bbdd.user}" password="${bbdd.password}" stableDBdir="${stableDBdir}" testDBdir="${basedir}" verbosity="${bbdd.verbosity}" />
   575     <checkAPI driver="${bbdd.driver}" 
       
   576                   url="${bbdd.owner.url}" 
       
   577                   user="${bbdd.user}" 
       
   578                   password="${bbdd.password}" 
       
   579                   stableDBdir="${stableDBdir}"
       
   580                   testDBdir="${basedir}"
       
   581                   verbosity="${bbdd.verbosity}"
       
   582     />    
   576   </target>
   583   </target>
   577 
   584 
   578   <target name="export.sample.data" depends="code.rev">
   585   <target name="export.sample.data" depends="code.rev">
   579     <ant dir="${base.src}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
   586     <ant dir="${base.src}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
   580   </target>
   587   </target>
   666   <target name="uninstallWebService" depends="init">
   673   <target name="uninstallWebService" depends="init">
   667     <ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true" />
   674     <ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true" />
   668   </target>
   675   </target>
   669 
   676 
   670   <target name="install.source" depends="init, create.database, wad.lib, trl.lib, compile.complete.deploy">
   677   <target name="install.source" depends="init, create.database, wad.lib, trl.lib, compile.complete.deploy">
   671     <echo message="applying modules" />
   678     <echo message="applying modules" />    
   672     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   679     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   673 
   680 
   674     <antcall target="import.sample.data" />
   681     <antcall target="import.sample.data" />
   675     <antcall target="load.logoimages" />
   682     <antcall target="load.logoimages" />
   676     <updatesystemstatus v="RB51" />
   683     <updatesystemstatus v="RB51"/> 
   677     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   684     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   678 
   685 
   679     <!--
   686     <!--
   680 		<antcall target="validate.database" />
   687 		<antcall target="validate.database" />
   681 		<antcall target="validate.modules" />
   688 		<antcall target="validate.modules" />
   683   </target>
   690   </target>
   684 
   691 
   685   <target name="eclipse.install.source" depends="init, create.database">
   692   <target name="eclipse.install.source" depends="init, create.database">
   686     <fail unless="eclipse.running" message="eclipse.* tasks must be executed inside Eclipse" />
   693     <fail unless="eclipse.running" message="eclipse.* tasks must be executed inside Eclipse" />
   687     <echo message="Building OpenbravoCore project..." level="info" />
   694     <echo message="Building OpenbravoCore project..." level="info" />
   688     <eclipse.incrementalBuild project="OpenbravoCore" kind="full" />
   695     <eclipse.incrementalBuild project="OpenbravoCore" kind="full"/>
   689     <antcall target="eclipse.wad.lib" />
   696     <antcall target="eclipse.wad.lib"/>
   690     <antcall target="eclipse.trl.lib" />
   697     <antcall target="eclipse.trl.lib"/>
   691     <antcall target="eclipse.compile.complete" />
   698     <antcall target="eclipse.compile.complete"/>
   692     <echo message="applying modules" />
   699     <echo message="applying modules" />    
   693     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   700     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
   694     <antcall target="import.sample.data" />
   701     <antcall target="import.sample.data" />
   695     <updatesystemstatus v="RB51" />
   702     <updatesystemstatus v="RB51"/>
   696     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   703     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   697   </target>
   704   </target>
   698 
   705 
   699   <target name="create.database" depends="init, core.lib, database.lib">
   706   <target name="create.database" depends="init, core.lib, database.lib">
   700     <ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
   707     <ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
   701     <antcall target="db.apply.modules.sampledata" />
   708     <antcall target="db.apply.modules.sampledata" />
   702   </target>
   709   </target>
   703 
   710 
   704   <target name="update.database" depends="init, core.lib, database.lib, buildvalidation">
   711   <target name="update.database" depends="init, core.lib, database.lib, buildvalidation">
   705     <updatesystemstatus v="RB12" />
   712     <updatesystemstatus v="RB12"/>
   706     <ant dir="${base.db}" target="update.database.java" inheritAll="true" inheritRefs="true" />
   713     <ant dir="${base.db}" target="update.database.java" inheritAll="true" inheritRefs="true" />
   707     <antcall target="generate.entities.quick" />
   714     <antcall target="generate.entities.quick" />
   708     <antcall target="apply.module" />
   715     <antcall target="apply.module" />
   709   </target>
   716   </target>
   710 
   717 
   711   <target name="update.database.mod" depends="init, core.lib, database.lib, buildvalidation">
   718   <target name="update.database.mod" depends="init, core.lib, database.lib, buildvalidation">
   712     <updatesystemstatus v="RB12" />
   719     <updatesystemstatus v="RB12"/>
   713     <ant dir="${base.db}" target="update.database.mod.java" inheritAll="true" inheritRefs="true" />
   720     <ant dir="${base.db}" target="update.database.mod.java" inheritAll="true" inheritRefs="true" />
   714     <antcall target="generate.entities.quick" />
   721     <antcall target="generate.entities.quick" />
   715     <antcall target="apply.module" />
   722     <antcall target="apply.module" />
   716   </target>
   723   </target>
   717 
   724 
   744 
   751 
   745 
   752 
   746   <target name="apply.modules">
   753   <target name="apply.modules">
   747 
   754 
   748     <condition property="apply.modules.complete.compilation.var">
   755     <condition property="apply.modules.complete.compilation.var">
   749       <istrue value="${apply.modules.complete.compilation}" />
   756       <istrue value="${apply.modules.complete.compilation}"  />
   750     </condition>
   757     </condition>
   751 
   758     
   752     <condition property="apply.modules.simple.compilation.var">
   759     <condition property="apply.modules.simple.compilation.var">
   753       <isfalse value="${apply.modules.complete.compilation.var}" />
   760       <isfalse value="${apply.modules.complete.compilation.var}" />
   754     </condition>
   761     </condition>
   755 
   762 
   756     <updatesystemstatus v="RB43" />
   763     <updatesystemstatus v="RB43"/>
   757     <antcall target="apply.modules.compile" />
   764     <antcall target="apply.modules.compile"/>
   758 
   765 
   759     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   766     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
   760 
   767 
   761   </target>
   768   </target>
   762 
   769   
   763   <target name="apply.module.forked">
   770   <target name="apply.module.forked">
   764     <!-- 
   771     <!-- 
   765     Note: set reinitializeModel to false because otherwise the dal is re-initialized with classes and a model
   772     Note: set reinitializeModel to false because otherwise the dal is re-initialized with classes and a model
   766     which are not in sync (see issue: https://issues.openbravo.com/view.php?id=9376)
   773     which are not in sync (see issue: https://issues.openbravo.com/view.php?id=9376)
   767     Note: applyModule can also be moved to a java task to fork it (to prevent this from occuring)
   774     Note: applyModule can also be moved to a java task to fork it (to prevent this from occuring)
   768     but then no output is visible for the user.
   775     but then no output is visible for the user.
   769     -->
   776     -->
   770     <taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
   777     <taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
   771       <classpath refid="project.class.path" />
   778       <classpath refid="project.class.path" />
   772     </taskdef>
   779     </taskdef>
   773     <applyModule userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" />
   780     <applyModule userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
   774   </target>
   781   </target>
   775 
   782   
   776   <target name="compile.apply.module" depends="init">
   783   <target name="compile.apply.module" depends="init">
   777     <updatesystemstatus v="RB31" />
   784     <updatesystemstatus v="RB31"/>
   778     <ant dir="${base.src}" target="compile.apply.module" inheritAll="true" inheritRefs="true" />
   785     <ant dir="${base.src}" target="compile.apply.module" inheritAll="true" inheritRefs="true" />
   779   </target>
   786   </target>
   780 
   787   
   781   <!--
   788   <!--
   782   This task uses a special classpath.
   789   This task uses a special classpath.
   783   This classpath is equivalent to the normal project.class.path, except for the fact that that the normal build folder
   790   This classpath is equivalent to the normal project.class.path, except for the fact that that the normal build folder
   784   is replaced by the apply.module.build folder, in which the ApplyModule task related classes will be compiled.
   791   is replaced by the apply.module.build folder, in which the ApplyModule task related classes will be compiled.
   785   This is done to workaround the fact that the javac task needs to compile all the related classes when upgrading openbravo
   792   This is done to workaround the fact that the javac task needs to compile all the related classes when upgrading openbravo
   788   <target name="apply.module" depends="compile.apply.module">
   795   <target name="apply.module" depends="compile.apply.module">
   789     <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" fork="true" maxmemory="${build.maxmemory}" failonerror="true">
   796     <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" fork="true" maxmemory="${build.maxmemory}" failonerror="true">
   790       <arg line="'${base.src}' '${friendlyWarnings}'" />
   797       <arg line="'${base.src}' '${friendlyWarnings}'" />
   791       <classpath refid="apply.module.runtime.classpath" />
   798       <classpath refid="apply.module.runtime.classpath" />
   792     </java>
   799     </java>
   793     <delete includeEmptyDirs="true" dir="${build.apply.module}" />
   800    <delete includeEmptyDirs="true"  dir="${build.apply.module}" />
   794   </target>
   801   </target>
   795 
   802   
   796   <target name="apply.modules.compile" depends="wad.lib">
   803   <target name="apply.modules.compile" depends="wad.lib">
   797     <antcall target="apply.modules.compile.simple" />
   804     <antcall target="apply.modules.compile.simple"/>
   798     <antcall target="apply.modules.compile.complete" />
   805     <antcall target="apply.modules.compile.complete"/>
   799   </target>
   806   </target>
   800 
   807   
   801   <target name="apply.modules.compile.simple" if="apply.modules.simple.compilation.var">
   808   <target name="apply.modules.compile.simple" if="apply.modules.simple.compilation.var">
   802     <antcall target="compile.deploy" />
   809     <antcall target="compile.deploy" />
   803   </target>
   810   </target>
   804 
   811   
   805   <target name="apply.modules.compile.complete" if="apply.modules.complete.compilation.var">
   812   <target name="apply.modules.compile.complete" if="apply.modules.complete.compilation.var">
   806     <antcall target="compile.complete.deploy" />
   813      <antcall target="compile.complete.deploy" />
   807   </target>
   814   </target>
   808 
   815   
   809   <!-- 
   816   <!-- 
   810 		apparently this does not overwrite the default catalina_opts, only
   817 		apparently this does not overwrite the default catalina_opts, only
   811 		if it is not set will it be set to the value below 
   818 		if it is not set will it be set to the value below 
   812 	-->
   819 	-->
   813   <property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
   820   <property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
   836       <arg line="stop" />
   843       <arg line="stop" />
   837     </java>
   844     </java>
   838     <sleep description="Wait to give tomcat time to stop" seconds="20" />
   845     <sleep description="Wait to give tomcat time to stop" seconds="20" />
   839 
   846 
   840     <!-- if deploy.mode=class this will sync (& delete orphan) jarfiles from WebContent -> tomcat-->
   847     <!-- if deploy.mode=class this will sync (& delete orphan) jarfiles from WebContent -> tomcat-->
   841     <antcall target="copy.files.jarsync" />
   848     <antcall target="copy.files.jarsync"/>
   842 
   849 
   843     <java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true">
   850     <java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true">
   844       <classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
   851       <classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
   845       <!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
   852       <!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
   846       <jvmarg line="${env.CATALINA_OPTS}" />
   853       <jvmarg line="${env.CATALINA_OPTS}" />
   914     </taskdef>
   921     </taskdef>
   915 
   922 
   916     <taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
   923     <taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
   917       <classpath refid="project.class.path" />
   924       <classpath refid="project.class.path" />
   918     </taskdef>
   925     </taskdef>
   919 
   926     
   920     <taskdef name="WADValidation" classname="org.openbravo.wad.validation.WADValidatorTask">
   927     <taskdef name="WADValidation" classname="org.openbravo.wad.validation.WADValidatorTask">
   921       <classpath refid="project.class.path" />
   928       <classpath refid="project.class.path" />
   922     </taskdef>
   929     </taskdef>
   923 
   930             
   924     <echo message="Validating Module..." />
   931     <echo message="Validating Module..." />
   925 
   932     
   926     <WADValidation propertiesFile="${base.config}/Openbravo.properties" modules="${module}" stoponerror="true" />
   933     <WADValidation propertiesFile="${base.config}/Openbravo.properties"
       
   934                    modules="${module}"
       
   935                    stoponerror="true"/>
   927 
   936 
   928     <validateModules moduleJavaPackage="${module}" failOnError="true" userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="module" />
   937     <validateModules moduleJavaPackage="${module}" failOnError="true" userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="module" />
   929 
   938 
   930     <antcall target="obx.export.database" />
   939     <antcall target="obx.export.database" />
   931     <antcall target="obx.export.config.script" />
   940     <antcall target="obx.export.config.script" />
  1023 
  1032 
  1024     <chmod file="config/setup-properties-${osname}${osarch}.${bin.ext}" perm="+x" />
  1033     <chmod file="config/setup-properties-${osname}${osarch}.${bin.ext}" perm="+x" />
  1025   </target>
  1034   </target>
  1026 
  1035 
  1027   <target name="package.core" depends="init, set.version.number">
  1036   <target name="package.core" depends="init, set.version.number">
  1028     <property name="tmpdir" value="${java.io.tmpdir}/ob.core${core.rev}" />
  1037 	<property name="tmpdir" value="${java.io.tmpdir}/ob.core${core.rev}" />
  1029 
  1038    
  1030     <exec executable="hg">
  1039   	<exec executable="hg" >
  1031       <arg value="archive" />
  1040   		<arg value="archive"/>
  1032       <arg value="${tmpdir}" />
  1041   		<arg value="${tmpdir}"/>
  1033     </exec>
  1042   	</exec>
  1034 
  1043   	
  1035     <replaceregexp file="${tmpdir}/src-db/database/sourcedata/AD_MODULE.xml" match="(VERSION.*\[CDATA\[).*\..*\.(.*)(\]\])" replace="\1${core.rev}\3" byline="true" />
  1044   	<replaceregexp file="${tmpdir}/src-db/database/sourcedata/AD_MODULE.xml"
  1036 
  1045                    match="(VERSION.*\[CDATA\[).*\..*\.(.*)(\]\])"
  1037     <echo message="${hg.id}" file="${tmpdir}/config/instance.revision" />
  1046                    replace="\1${core.rev}\3"
  1038 
  1047                    byline="true"/>
       
  1048     
       
  1049     <echo message="${hg.id}" file="${tmpdir}/config/instance.revision"/>
       
  1050 	
  1039     <delete includeEmptyDirs="true">
  1051     <delete includeEmptyDirs="true">
  1040       <fileset dir="${tmpdir}/modules" includes="**/*" defaultexcludes="no" />
  1052       <fileset dir="${tmpdir}/modules" includes="**/*" defaultexcludes="no"/>
  1041     </delete>
  1053     </delete>
  1042 
  1054     
  1043     <zip destfile="${basedir}/core-${core.rev}.obx" basedir="${tmpdir}" />
  1055     <zip destfile="${basedir}/core-${core.rev}.obx" basedir="${tmpdir}"/>
  1044 
  1056     
  1045     <delete dir="${tmpdir}" />
  1057     <delete dir="${tmpdir}"/>
  1046 
  1058 
  1047   </target>
  1059    </target>
  1048 
  1060  
  1049   <target name="set.version.number" depends="set.version.from.file, set.version.calculated" />
  1061   <target name="set.version.number" depends="set.version.from.file, set.version.calculated"/>
  1050 
  1062   
  1051   <target name="set.version.calculated" if="calculate.core.rev">
  1063   <target name="set.version.calculated" if="calculate.core.rev">
  1052     <echo message="calculating core revision..." />
  1064     <echo message="calculating core revision..."/>
  1053     <exec executable="hg" outputproperty="hg.idno" failifexecutionfails="false">
  1065     <exec executable="hg" outputproperty="hg.idno" failifexecutionfails="false">
  1054       <arg value="id" />
  1066       <arg value="id"/>
  1055       <arg value="-n" />
  1067       <arg value="-n"/>
  1056     </exec>
  1068     </exec>
  1057     <taskdef name="CoreRevision" classname="org.openbravo.erpCommon.utility.CalculateCoreRevision">
  1069     <taskdef name="CoreRevision" classname="org.openbravo.erpCommon.utility.CalculateCoreRevision">
  1058       <classpath refid="project.class.path" />
  1070             <classpath refid="project.class.path" />
  1059     </taskdef>
  1071           </taskdef>
  1060 
  1072 
  1061     <CoreRevision hgRevNo="${hg.idno}" revision="core.rev" />
  1073     <CoreRevision hgRevNo="${hg.idno}" revision="core.rev"/>
  1062   </target>
  1074   </target>
  1063 
  1075   
  1064   <target name="set.version.from.file" if="xml.core.rev">
  1076   <target name="set.version.from.file" if="xml.core.rev">
  1065     <echo message="reading core revision from xml file..." />
  1077     <echo message="reading core revision from xml file..."/>
  1066     <loadfile property="core.rev" srcfile="${basedir}/src-db/database/sourcedata/AD_MODULE.xml">
  1078     <loadfile property="core.rev" srcfile="${basedir}/src-db/database/sourcedata/AD_MODULE.xml">
  1067       <filterchain>
  1079       <filterchain>
  1068         <linecontains>
  1080         <linecontains>
  1069           <contains value="VERSION>" />
  1081           <contains value="VERSION>"/>
  1070         </linecontains>
  1082         </linecontains>
  1071         <tokenfilter>
  1083         <tokenfilter>
  1072           <replaceregex pattern="(.*VERSION.*\[CDATA\[)(.*\..*\..*)(\]\].*)" replace="\2" />
  1084             <replaceregex pattern="(.*VERSION.*\[CDATA\[)(.*\..*\..*)(\]\].*)" replace="\2"/>
  1073         </tokenfilter>
  1085         </tokenfilter>
  1074         <striplinebreaks />
  1086         <striplinebreaks/>
  1075       </filterchain>
  1087       </filterchain>
  1076     </loadfile>
  1088     </loadfile>
  1077   </target>
  1089   </target>
  1078 
  1090   
  1079 
  1091   
  1080   <target name="load.logoimages">
  1092   <target name="load.logoimages">
  1081     <ant dir="${base.src}" target="load.logoimages" inheritAll="true" inheritRefs="true" />
  1093     <ant dir="${base.src}" target="load.logoimages" inheritAll="true" inheritRefs="true" />
  1082   </target>
  1094   </target>
  1083 
  1095   
  1084   <target name="validate.wad">
  1096   <target name="validate.wad">
  1085     <ant dir="${base.src}" target="wadvalidation" inheritAll="true" inheritRefs="true" />
  1097     <ant dir="${base.src}" target="wadvalidation" inheritAll="true" inheritRefs="true" />
  1086   </target>
  1098   </target>
  1087 
  1099   
  1088   <target name="UIrebuild" depends="core.lib">
  1100   <target name="UIrebuild" depends="core.lib">
  1089     <java classname="org.openbravo.base.BuildTask" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
  1101     <java classname="org.openbravo.base.BuildTask" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
  1090       <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
  1102       <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
  1091       <classpath>
  1103       <classpath>
  1092         <pathelement path="${build.core.lib}/openbravo-core.jar" />
  1104         <pathelement path="${build.core.lib}/openbravo-core.jar" />
  1101         <pathelement path="${base.lib}/runtime/ant-apache-log4j.jar" />
  1113         <pathelement path="${base.lib}/runtime/ant-apache-log4j.jar" />
  1102         <pathelement path="${base.lib}/runtime/ant-nodeps.jar" />
  1114         <pathelement path="${base.lib}/runtime/ant-nodeps.jar" />
  1103       </classpath>
  1115       </classpath>
  1104     </java>
  1116     </java>
  1105   </target>
  1117   </target>
  1106 
  1118   
  1107   <target name="check.module.consistency">
  1119   <target name="check.module.consistency">
  1108     <taskdef name="checkConsistency" classname="org.openbravo.erpCommon.modules.CheckLocalConsistency">
  1120     <taskdef name="checkConsistency" classname="org.openbravo.erpCommon.modules.CheckLocalConsistency">
  1109       <classpath refid="project.class.path" />
  1121       <classpath refid="project.class.path" />
  1110     </taskdef>
  1122     </taskdef>
  1111     <checkConsistency userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" />
  1123     <checkConsistency userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
  1112   </target>
  1124   </target>
  1113 
  1125   
  1114   <target name="check.window.compatibility">
  1126   <target name="check.window.compatibility">
  1115     <taskdef name="showclassicwindows" classname="org.openbravo.client.application.WindowsInClassicModeTask">
  1127     <taskdef name="showclassicwindows" classname="org.openbravo.client.application.WindowsInClassicModeTask">
  1116       <classpath refid="project.class.path" />
  1128       <classpath refid="project.class.path" />
  1117     </taskdef>
  1129     </taskdef>
  1118     <showclassicwindows userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" />
  1130     <showclassicwindows userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
  1119   </target>
  1131   </target>
  1120 </project>
  1132 </project>