Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <project name="HelloWorld" default="compile" basedir=".">
- <!-- Name of project and version -->
- <property name="proj.name" value="HelloWorld" />
- <property name="proj.version" value="1.0" />
- <!-- Global properties for this build -->
- <property name="src.java.dir" value="src" />
- <property name="lib.dir" value="lib" />
- <property name="build.dir" value="bin" />
- <!-- Classpath declaration -->
- <path id="project.classpath">
- <fileset dir="${lib.dir}">
- <include name="**/*.jar" />
- <include name="**/*.zip" />
- </fileset>
- </path>
- <!-- Useful shortcuts -->
- <patternset id="meta.files">
- <include name="**/*.xml" />
- <include name="**/*.properties" />
- </patternset>
- <!-- Clean up -->
- <target name="clean">
- <delete dir="${build.dir}" />
- <mkdir dir="${build.dir}" />
- </target>
- <!-- Compile Java source -->
- <target name="compile" depends="clean">
- <mkdir dir="${build.dir}" />
- <javac srcdir="${src.java.dir}" destdir="${build.dir}" nowarn="on">
- <classpath refid="project.classpath" />
- </javac>
- </target>
- <!-- Copy metadata to build classpath -->
- <target name="copymetafiles">
- <copy todir="${build.dir}">
- <fileset dir="${src.java.dir}">
- <patternset refid="meta.files" />
- </fileset>
- </copy>
- </target>
- <!-- Run HelloWorld -->
- <target name="run" depends="compile, copymetafiles" description="Build and run HelloWorld">
- <java fork="true" classname="hello.HelloWorld" classpathref="project.classpath">
- <classpath path="${build.dir}" />
- </java>
- </target>
- <!-- target for shema export -->
- <taskdef name="hibernatetool"
- classname="org.hibernate.tool.ant.HibernateToolTask"
- classpathref="project.classpath" />
- <target name="schemaexport" depends="compile, copymetafiles"
- description="Exports a generated schema to DB and file">
- <hibernatetool destdir="${basedir}">
- <classpath path="${build.dir}" />
- <configuration
- configurationfile="${build.dir}/hibernate.cfg.xml" />
- <hbm2ddl
- drop="true"
- create="true"
- export="true"
- outputfilename="helloworld-ddl.sql"
- delimiter=";"
- format="true" />
- </hibernatetool>
- </target>
- <target name="dbmanager" description="Start HSQLDB manager">
- <java
- classname="org.hsqldb.util.DatabaseManagerSwing"
- fork="yes"
- classpathref="project.classpath"
- failonerror="true">
- <arg value="-url"/>
- <arg value="jdbc:hsqldb:hsql://localhost/"/>
- <arg value="-driver"/>
- <arg value="org.hsqldb.jdbcDriver"/>
- </java>
- </target>
- </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement