361 lines
15 KiB
XML
361 lines
15 KiB
XML
<project name="dbcfxgo" default="speaker" basedir=".">
|
|
<condition property="isWindowsOs">
|
|
<os family="windows"/>
|
|
</condition>
|
|
<condition property="isAixOs">
|
|
<os family="unix" name="aix"/>
|
|
</condition>
|
|
<condition property="build.prop.file.path" value="winxp">
|
|
<isset property="isWindowsOs"/>
|
|
</condition>
|
|
<condition property="build.prop.file.path" value="aix">
|
|
<isset property="isAixOs"/>
|
|
</condition>
|
|
<property name="build.prop.file" value="${build.prop.file.path}/build_${user.name}.properties"/>
|
|
<property environment="env"/>
|
|
<property file="${build.prop.file}"/>
|
|
<property name="build.path" value="${project.home}/build"/>
|
|
<property name="building.path" value="${build.path}/building"/>
|
|
<property name="dbcfxgo.src.path" value="${project.home}/src"/>
|
|
<property name="dbcfxgo.ejb.path" value="${project.home}/ejb"/>
|
|
<property name="dbcfxgo.web.path" value="${project.home}/web/res"/>
|
|
<property name="dbcfxgo.ear.path" value="${project.home}/ear"/>
|
|
<property name="dbcfxgo.web.lib.path" value="" />
|
|
<property name="dbcfxgo.classes.path" value="${building.path}/dbcfxgo-classes"/>
|
|
<property name="dbcfxgo.hibernate.destdir.path" value="${dbcfxgo.src.path}/${destDir}"/>
|
|
<property name="dbcfxgo.hibernate.gen.configFile" value="${build.path}/hibernate/hibernateGen.cfg.xml"/>
|
|
<property name="dbcfxgo.hibernate.gen.revengeFile" value="${build.path}/hibernate/${rev}"/>
|
|
<property name="dbcfxgo.hibernate.gen.revengeFileFK" value="${build.path}/hibernate/${revFK}"/>
|
|
<property name="dbcfxgo.hibernate.gen.lib.path" value="${build.path}/hibernate/genLib"/>
|
|
<!-- define a mapper for Home to DAO -->
|
|
<mapper id="DAOMapper" type="glob" from="*Home.java" to="*DAO.java"/>
|
|
<!-- PATTERN PER GLI LE CLASSI EJB DI DBCFX-EJB-MODULE -->
|
|
<patternset id="dbcfxgo.ejb.classes">
|
|
<include name="**/ejb/**/*.class"/>
|
|
</patternset>
|
|
<!-- PATTERN PER LE CLASSI DEL MODULO WEB -->
|
|
<patternset id="dbcfxgo.web.classes">
|
|
<include name="**/web/**/*.class"/>
|
|
</patternset>
|
|
<!-- PATTERN PER LE CLASSI COMUNI UTILIZZATE DA EJB E WEB, DBCFX-COMMON.JAR -->
|
|
<patternset id="dbcfxgo.common.classes">
|
|
<include name="**/core/**/*.class"/>
|
|
</patternset>
|
|
<!-- PATTERN PER RECUPERARE LE RISORSE DENTRO APP-INF PER L'EAR -->
|
|
<patternset id="dbcfxgo.ear.resources">
|
|
<exclude name="**/CVS/**"/>
|
|
<exclude name="**/*.bak"/>
|
|
<exclude name="**/application.xml"/>
|
|
</patternset>
|
|
<!-- PATTERN PER RECUPERARE I FILE XML DI CONFIGURAZIONE DI HIBERNATE -->
|
|
<patternset id="dbcfxgo.hibernate.cfg.xml">
|
|
<include name="**/*hbm.xml"/>
|
|
<include name="**/*cfg.xml"/>
|
|
</patternset>
|
|
<!-- LIB per la compilazione degli oggetti di hibernate -->
|
|
<filelist id="hibernate.compile.files.classpath" dir="${dbcfxgo.lib.path}">
|
|
<file name="hibernate-c3p0-0.9.0.jar"/>
|
|
<file name="hibernate-cglib-2.1.3.jar"/>
|
|
<file name="hibernate-ehcache-1.2.jar"/>
|
|
<file name="hibernate3.jar"/>
|
|
<file name="hibernate-jgroups-2.2.8.jar"/>
|
|
<file name="hibernate-antlr-2.7.6rc1.jar"/>
|
|
<file name="logging.jar"/>
|
|
<file name="log4j-1.2.7.jar"/>
|
|
<file name="hibernate-dom4j-1.5.2.jar"/>
|
|
<file name="hibernate-asm.jar"/>
|
|
<file name="hibernate-asm-attrs.jar"/>
|
|
<file name="hibernate-commons-collections-2.1.1.jar"/>
|
|
</filelist>
|
|
<!-- LIBRERIE PER LA COMPILAZIONE -->
|
|
<filelist id="weblogic.jar" dir="${weblogic.home}/server/lib">
|
|
<file name="weblogic.jar"/>
|
|
</filelist>
|
|
<!-- LIB per la generazione degli oggetti di hibernate -->
|
|
<filelist id="hibernate.gen.files.classpath" dir="${dbcfxgo.hibernate.gen.lib.path}">
|
|
<file name="hibernate-tools-GNPGOcustom.jar"/>
|
|
<file name="classes12.jar"/>
|
|
<file name="freemarker.jar"/>
|
|
<file name="jtidy-r8-20060801.jar"/>
|
|
</filelist>
|
|
<!-- LIBRERIE PER LA COMPILAZIONE -->
|
|
<filelist id="dbcfxgo.libs" dir="${dbcfxgo.lib.path}">
|
|
<file name="hibernate-xml-apis.jar" />
|
|
<file name="jakarta-oro-2.0.5.jar" />
|
|
<file name="log4j-1.2.7.jar" />
|
|
<file name="logging.jar" />
|
|
<file name="security-utility.jar" />
|
|
<file name="castor-1.3.2.jar" />
|
|
<file name="castor-1.3.2-anttasks.jar" />
|
|
<file name="castor-1.3.2-codegen.jar" />
|
|
<file name="castor-1.3.2-core.jar" />
|
|
<file name="castor-1.3.2-ddlgen" />
|
|
<file name="castor-1.3.2-xml.jar" />
|
|
<file name="castor-1.3.2-xml-schema" />
|
|
<file name="commons-lang-2.1" />
|
|
<file name="Castor-DbcFX2DbcFXGO.jar" />
|
|
<file name="commons-collections-3.1.jar" />
|
|
<file name="commons-fileupload-1.0.jar" />
|
|
<file name="commons-logging-1.1.1.jar" />
|
|
<file name="commons-logging-api-1.1.1.jar" />
|
|
<file name="commons-net-1.3.0.jar" />
|
|
<file name="datedFileAppender-1.0.2.jar" />
|
|
<file name="dom4j-1.6.1.jar" />
|
|
<file name="hibernate3.jar" />
|
|
<file name="hibernate-antlr-2.7.6rc1.jar" />
|
|
<file name="hibernate-asm.jar" />
|
|
<file name="hibernate-asm-attrs.jar" />
|
|
<file name="hibernate-c3p0-0.9.0.jar" />
|
|
<file name="hibernate-cglib-2.1.3.jar" />
|
|
<file name="hibernate-cleanimports.jar" />
|
|
<file name="hibernate-ehcache-1.2.jar" />
|
|
<file name="hibernate-jaxen-1.1-beta-4.jar" />
|
|
<file name="hibernate-jgroups-2.2.8.jar" />
|
|
<file name="hibernate-jta.jar" />
|
|
<file name="hibernate-xerces-2.6.2.jar" />
|
|
</filelist>
|
|
<!-- CLASSPATH PER LA COMPILAZIONE-->
|
|
<path id="all.classpath">
|
|
<filelist refid="dbcfxgo.libs"/>
|
|
<fileset dir="${dbcfxgo.web.path}">
|
|
<include name="**/*.jar"/>
|
|
</fileset>
|
|
<filelist refid="weblogic.jar"/>
|
|
<!-- LIB SSL AIX x compilazione su WINDOWS-->
|
|
<fileset dir="${dbcfxgo.lib.path}">
|
|
<include name="ibmjsseprovider.jar" if="isWindowsOs"/>
|
|
</fileset>
|
|
<!-- DBCFX CLASSES -->
|
|
<pathelement path="${dbcfxgo.classes.path}"/>
|
|
<!-- Java compiler tools.jar -->
|
|
<pathelement location="${sdk.home}/lib/tools.jar"/>
|
|
</path>
|
|
<path id="hibernate.gen.all.claspath">
|
|
<fileset dir="${dbcfxgo.lib.path}">
|
|
<include name="*.jar"/>
|
|
</fileset>
|
|
<filelist refid="hibernate.gen.files.classpath"/>
|
|
<filelist refid="hibernate.compile.files.classpath"/>
|
|
<filelist refid="weblogic.jar"/>
|
|
</path>
|
|
<!-- ################################################################################ -->
|
|
<!-- ################################################################################ -->
|
|
<!-- ################################################################################ -->
|
|
<target name="test">
|
|
<echo>
|
|
isWindowsOs=${isWindowsOs}
|
|
isWindowsXpOs=${isWindowsXpOs}
|
|
isAixOs=${isAixOs}
|
|
user.name=${user.name}
|
|
prop.file.path=${prop.file.path}
|
|
build.prop.file=${build.prop.file}
|
|
</echo>
|
|
</target>
|
|
<target name="echo">
|
|
<echo>
|
|
Starting build using:
|
|
sdk.home= ${sdk.home}
|
|
weblogic.home= ${weblogic.home}
|
|
project.home= ${project.home}
|
|
dbcfxgo.lib.path= ${dbcfxgo.lib.path}
|
|
build.prop.file= ${build.prop.file}
|
|
|
|
</echo>
|
|
<input message="Ok to continue? " validargs="y,n" addproperty="do.continue" />
|
|
<condition property="do.abort">
|
|
<equals arg1="n" arg2="${do.continue}" />
|
|
</condition>
|
|
<fail if="do.abort">Build aborted by user.</fail>
|
|
</target>
|
|
<target name="init">
|
|
<tstamp prefix="start" />
|
|
<echo>
|
|
Build started at: ${start.DSTAMP} ${start.TSTAMP}
|
|
-----------------
|
|
|
|
sdk.home= ${sdk.home}
|
|
weblogic.home= ${weblogic.home}
|
|
project.home= ${project.home}
|
|
dbcfxgo.lib.path= ${dbcfxgo.lib.path}
|
|
build.prop.file= ${build.prop.file}
|
|
|
|
</echo>
|
|
<delete dir="${building.path}" />
|
|
<mkdir dir="${building.path}" />
|
|
<mkdir dir="${dbcfxgo.classes.path}" />
|
|
<mkdir dir="${building.path}/dbcfxgo-ejbmodule-jar" />
|
|
<mkdir dir="${building.path}/dbcfxgo-ejbclient-jar" />
|
|
<mkdir dir="${building.path}/dbcfxgo-war/WEB-INF/classes" />
|
|
<mkdir dir="${building.path}/dbcfxgo-ear/APP-INF/classes" />
|
|
<mkdir dir="${building.path}/dbcfxgo-ear/APP-INF/lib" />
|
|
</target>
|
|
<target name="compile_dbcfxgo" depends="init">
|
|
<echo>
|
|
Compiling DBCFX-GO classes
|
|
-------------
|
|
</echo>
|
|
<javac srcdir="${dbcfxgo.src.path}" destdir="${dbcfxgo.classes.path}" debug="on" deprecation="off" failonerror="true">
|
|
<classpath refid="all.classpath" />
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="jar_dbcfxgo_client_ejb" depends="compile_dbcfxgo">
|
|
<echo>
|
|
Creating client jar dbcfxgo_ejb_client
|
|
--------------
|
|
</echo>
|
|
<jar destfile="${building.path}/dbcfxgo-ejb-client.jar">
|
|
<fileset dir="${dbcfxgo.classes.path}">
|
|
<patternset refid="dbcfxgo.ejb.classes" />
|
|
</fileset>
|
|
</jar>
|
|
</target>
|
|
<!-- Inizio Creazione dbcfx-ejbmodule-jar-->
|
|
<target name="jar_ejb" depends="compile_dbcfxgo">
|
|
<copy todir="${building.path}/dbcfxgo-ejbmodule-jar">
|
|
<fileset dir="${dbcfxgo.ejb.path}">
|
|
<patternset refid="dbcfxgo.ear.resources" />
|
|
</fileset>
|
|
<fileset dir="${dbcfxgo.classes.path}">
|
|
<patternset refid="dbcfxgo.ejb.classes" />
|
|
</fileset>
|
|
</copy>
|
|
<echo>
|
|
Compiling weblogic ejbc dbcfxgo-ejbmodule.jar
|
|
-------------
|
|
</echo>
|
|
<java fork="true" failonerror="true" classname="weblogic.appc">
|
|
<classpath refid="all.classpath" />
|
|
<arg value="${building.path}/dbcfxgo-ejbmodule-jar" />
|
|
</java>
|
|
<jar destfile="${building.path}/dbcfxgo-ejbmodule.jar">
|
|
<fileset dir="${building.path}/dbcfxgo-ejbmodule-jar" />
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="war_dbcfxgo" depends="jar_dbcfxgo_client_ejb">
|
|
<echo>
|
|
Creating dbcfxgo.war
|
|
-------------
|
|
</echo>
|
|
<copy todir="${building.path}/dbcfxgo-war">
|
|
<fileset dir="${dbcfxgo.web.path}">
|
|
<patternset refid="dbcfxgo.ear.resources" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${building.path}/dbcfxgo-war/WEB-INF/classes">
|
|
<fileset dir="${dbcfxgo.classes.path}">
|
|
<patternset refid="dbcfxgo.web.classes" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${building.path}/dbcfxgo-war/WEB-INF/lib" file="${building.path}/dbcfxgo-ejb-client.jar" />
|
|
<war destfile="${building.path}/dbcfxgo.war" webxml="${building.path}/dbcfxgo-war/WEB-INF/web.xml">
|
|
<fileset dir="${building.path}/dbcfxgo-war" />
|
|
</war>
|
|
</target>
|
|
<target name="jar_dbcfxgo_common" depends="compile_dbcfxgo">
|
|
<echo>
|
|
Creating dbcfxgo-common.jar
|
|
-------------
|
|
</echo>
|
|
<jar destfile="${building.path}/dbcfxgo-common.jar">
|
|
<fileset dir="${dbcfxgo.classes.path}">
|
|
<patternset refid="dbcfxgo.common.classes" />
|
|
</fileset>
|
|
<fileset dir="${dbcfxgo.src.path}">
|
|
<patternset refid="dbcfxgo.hibernate.cfg.xml" />
|
|
</fileset>
|
|
</jar>
|
|
</target>
|
|
<target name="ear" depends="jar_ejb,jar_dbcfxgo_client_ejb,jar_dbcfxgo_common,war_dbcfxgo">
|
|
<echo>
|
|
Creating dbcfxgo.ear
|
|
-------------
|
|
</echo>
|
|
<copy todir="${building.path}/dbcfxgo-ear">
|
|
<fileset dir="${dbcfxgo.ear.path}/res">
|
|
<patternset refid="dbcfxgo.ear.resources" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${building.path}/dbcfxgo-ear/APP-INF/lib" file="${building.path}/dbcfxgo-common.jar" />
|
|
<copy todir="${building.path}/dbcfxgo-ear" file="${building.path}/dbcfxgo-ejbmodule.jar" />
|
|
<copy todir="${building.path}/dbcfxgo-ear" file="${building.path}/dbcfxgo.war" />
|
|
<ear destfile="${building.path}/dbcfxgo.ear" appxml="${dbcfxgo.ear.path}/res/META-INF/application.xml">
|
|
<fileset dir="${building.path}/dbcfxgo-ear" />
|
|
</ear>
|
|
</target>
|
|
<target name="cleanup" depends="ear">
|
|
<mkdir dir="${build.path}/deploy_${start.DSTAMP}_${start.TSTAMP}" />
|
|
<copy todir="${build.path}/deploy_${start.DSTAMP}_${start.TSTAMP}" file="${building.path}/dbcfxgo.ear" />
|
|
<delete dir="${building.path}" />
|
|
</target>
|
|
<target name="speaker" if="isWindowsOs" unless="fun.done" depends="cleanup">
|
|
<sound>
|
|
<success source="${env.ANT_HOME}/sounds/alrighty.wav" />
|
|
<fail source="${env.ANT_HOME}/sounds/warning_warning.wav" loops="1" />
|
|
</sound>
|
|
<property name="fun.done" value="true" />
|
|
</target>
|
|
<!-- TARGET PER LA CREAZIONE DEI DTO E FILE XML DI MAPPING-->
|
|
<target name="hibernateGenDto">
|
|
<echo>
|
|
Creating Hibernate DTO Objects and XML Mapping
|
|
-------------
|
|
</echo>
|
|
<!-- DEFINIZIONE TASK GENERAZIONE XML E POJO -->
|
|
<taskdef name="hibernatetoolGenPojoXml" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hibernate.gen.all.claspath" />
|
|
<!-- DEFINIZIONE TASK GENERAZIONE XML E POJO PER LE TABELLE CON FK-->
|
|
<taskdef name="hibernatetoolFKGenPojoXml" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hibernate.gen.all.claspath" />
|
|
<!-- IMPLEMENTAZIONE TASK GENERAZIONE XML E POJO-->
|
|
<hibernatetoolGenPojoXml>
|
|
<jdbcconfiguration configurationfile="${dbcfxgo.hibernate.gen.configFile}" revengfile="${dbcfxgo.hibernate.gen.revengeFile}" detectmanytomany="false" detectoptimisticlock="true" />
|
|
<hbm2hbmxml destdir="${dbcfxgo.hibernate.destdir.path}" />
|
|
<hbm2java destdir="${dbcfxgo.hibernate.destdir.path}" jdk5="true" />
|
|
</hibernatetoolGenPojoXml>
|
|
<!-- IMPLEMENTAZIONE TASK GENERAZIONE XML E POJO LE TABELLE CON FK -->
|
|
<hibernatetoolFKGenPojoXml>
|
|
<jdbcconfiguration configurationfile="${dbcfxgo.hibernate.gen.configFile}" revengfile="${dbcfxgo.hibernate.gen.revengeFileFK}" detectmanytomany="false" detectoptimisticlock="true" />
|
|
<hbm2hbmxml destdir="${dbcfxgo.hibernate.destdir.path}" />
|
|
<hbm2java destdir="${dbcfxgo.hibernate.destdir.path}" jdk5="true" />
|
|
</hibernatetoolFKGenPojoXml>
|
|
</target>
|
|
<!-- FINE TARGET PER LA CREAZIONE DEI DTO E FILE XML DI MAPPING-->
|
|
<!-- INIZIO DEI TARGET PER LA GESTIONE DELLA CREAZIONE DEI DAO-->
|
|
<target name="hibernateDAO">
|
|
<echo>
|
|
Creating Hibernate DAO Objects -
|
|
ATTENZIONE VERRANNO GENERATI I DAO STANDARD ELIMINADO COSI' LE PERSONALIZZAZIONI
|
|
-------------
|
|
</echo>
|
|
<!-- DEFINIZIONE TASK GENERAZIONE DAO -->
|
|
<taskdef name="hibernatetoolGenDAO" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hibernate.gen.all.claspath" />
|
|
<!-- DEFINIZIONE TASK GENERAZIONE DAO PER LE TABELLE CON FK-->
|
|
<taskdef name="hibernatetoolFKGenDAO" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hibernate.gen.all.claspath" />
|
|
<!-- IMPLEMENTAZIONE TASK GENERAZIONE DAO-->
|
|
<hibernatetoolGenDAO>
|
|
<jdbcconfiguration configurationfile="${dbcfxgo.hibernate.gen.configFile}" revengfile="${dbcfxgo.hibernate.gen.revengeFile}" detectmanytomany="false" detectoptimisticlock="true" />
|
|
<hbm2dao destdir="${dbcfxgo.hibernate.destdir.path}" jdk5="true" />
|
|
</hibernatetoolGenDAO>
|
|
<!-- IMPLEMENTAZIONE TASK GENERAZIONE DAO LE TABELLE CON FK -->
|
|
<hibernatetoolFKGenDAO>
|
|
<jdbcconfiguration configurationfile="${dbcfxgo.hibernate.gen.configFile}" revengfile="${dbcfxgo.hibernate.gen.revengeFileFK}" detectmanytomany="false" detectoptimisticlock="true" />
|
|
<hbm2dao destdir="${dbcfxgo.hibernate.destdir.path}" jdk5="true" />
|
|
</hibernatetoolFKGenDAO>
|
|
</target>
|
|
<target name="hibernateGenDao" depends="hibernateDAO">
|
|
<echo>
|
|
Renaming Hibernate DAO
|
|
-------------
|
|
</echo>
|
|
<taskdef name="move" classname="org.apache.tools.ant.taskdefs.Move" classpathref="hibernate.gen.all.claspath" />
|
|
<move todir="${dbcfxgo.hibernate.destdir.path}">
|
|
<!-- the files to move -->
|
|
<fileset dir="${dbcfxgo.hibernate.destdir.path}">
|
|
<include name="**/*Home.java" />
|
|
</fileset>
|
|
<mapper refid="DAOMapper" />
|
|
</move>
|
|
</target>
|
|
<!-- FINE DEI TARGET PER LA GESTIONE DELLA CREAZIONE DEI DAO-->
|
|
</project>
|