Advertisement
Guest User

build.xml

a guest
Nov 24th, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.55 KB | None | 0 0
  1. <project name="HelloWorld" default="compile" basedir=".">
  2.  
  3.     <!-- Name of project and version -->
  4.     <property name="proj.name" value="HelloWorld" />
  5.     <property name="proj.version" value="1.0" />
  6.  
  7.     <!-- Global properties for this build -->
  8.     <property name="src.java.dir"   value="src" />
  9.     <property name="lib.dir"        value="lib" />
  10.     <property name="build.dir"      value="bin" />
  11.  
  12.     <!-- Classpath declaration -->
  13.     <path id="project.classpath">
  14.         <fileset dir="${lib.dir}">
  15.             <include name="**/*.jar" />
  16.             <include name="**/*.zip" />
  17.         </fileset>
  18.     </path>
  19.  
  20.     <!-- Useful shortcuts -->
  21.     <patternset id="meta.files">
  22.         <include name="**/*.xml" />
  23.         <include name="**/*.properties" />
  24.     </patternset>
  25.  
  26.     <!-- Clean up -->
  27.     <target name="clean">
  28.         <delete dir="${build.dir}" />
  29.         <mkdir dir="${build.dir}" />
  30.     </target>
  31.  
  32.     <!-- Compile Java source -->
  33.     <target name="compile" depends="clean">
  34.         <mkdir dir="${build.dir}" />
  35.         <javac srcdir="${src.java.dir}" destdir="${build.dir}" nowarn="on">
  36.             <classpath refid="project.classpath" />
  37.         </javac>
  38.     </target>
  39.  
  40.     <!-- Copy metadata to build classpath -->
  41.     <target name="copymetafiles">
  42.         <copy todir="${build.dir}">
  43.             <fileset dir="${src.java.dir}">
  44.                 <patternset refid="meta.files" />
  45.             </fileset>
  46.         </copy>
  47.     </target>
  48.  
  49.     <!-- Run HelloWorld -->
  50.     <target name="run" depends="compile, copymetafiles" description="Build and run HelloWorld">
  51.         <java fork="true" classname="hello.HelloWorld" classpathref="project.classpath">
  52.             <classpath path="${build.dir}" />
  53.         </java>
  54.     </target>
  55.  
  56.     <!-- target for shema export -->
  57.     <taskdef name="hibernatetool"
  58.              classname="org.hibernate.tool.ant.HibernateToolTask"
  59.              classpathref="project.classpath" />
  60.    
  61.     <target name="schemaexport" depends="compile, copymetafiles"
  62.         description="Exports a generated schema to DB and file">
  63.        
  64.         <hibernatetool destdir="${basedir}">
  65.             <classpath path="${build.dir}" />
  66.            
  67.             <configuration
  68.                 configurationfile="${build.dir}/hibernate.cfg.xml" />
  69.            
  70.             <hbm2ddl
  71.                 drop="true"
  72.                 create="true"
  73.                 export="true"
  74.                 outputfilename="helloworld-ddl.sql"
  75.                 delimiter=";"
  76.                 format="true" />
  77.            
  78.         </hibernatetool>
  79.     </target>
  80.    
  81.     <target name="dbmanager" description="Start HSQLDB manager">
  82.         <java
  83.             classname="org.hsqldb.util.DatabaseManagerSwing"
  84.             fork="yes"
  85.             classpathref="project.classpath"
  86.             failonerror="true">
  87.             <arg value="-url"/>
  88.             <arg value="jdbc:hsqldb:hsql://localhost/"/>
  89.             <arg value="-driver"/>
  90.             <arg value="org.hsqldb.jdbcDriver"/>
  91.         </java>
  92.     </target>
  93.  
  94. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement