Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ant/docs/examples/5-minute-tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
To run this example:
- Have [Apache Ant](https://ant.apache.org) installed
- Have [H2 Sakila database](https://github.com/koentsje/sakila-h2) running
- Issue `ant reveng` from a command-line window
- Issue `ant` from a command-line window
39 changes: 11 additions & 28 deletions ant/docs/examples/5-minute-tutorial/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,22 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="5-minute-tutorial" default="reveng">

<property name="hibernate-tools.version" value="7.0.0.CR1"/>
<property name="jdbc-driver.org" value="com.h2database"/>
<property name="jdbc-driver.module" value="h2"/>
<property name="jdbc-driver.version" value="2.3.232"/>
<!-- Include the 'hibernatetool' task definition from the file '../common/included.xml' -->
<include file="../common/included.xml"/>

<ivy:cachepath
organisation="org.hibernate.tool"
module="hibernate-tools-ant"
revision="${hibernate-tools.version}"
pathid="hibernate-tools.path"
inline="true"/>
<ivy:cachepath
organisation="${jdbc-driver.org}"
module="${jdbc-driver.module}"
revision="${jdbc-driver.version}"
pathid="jdbc-driver.path"
inline="true"/>

<path id="classpath">
<path refid="hibernate-tools.path"/>
<path refid="jdbc-driver.path"/>
</path>

<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath" />
<target name="clean">
<!-- Delete the folder 'generated-sources' if it exists -->
<delete dir="generated-sources"/>
</target>

<target name="reveng">
<target name="reveng" depends="clean">
<!-- Generation of the artefacts in folder 'generated-sources' -->
<hibernatetool destdir="generated-sources">
<!-- JDBC Configuration with properties in file 'hibernate.properties' -->
<jdbcconfiguration propertyfile="hibernate.properties" />
<!-- The Java file exporter -->
<hbm2java/>
</hibernatetool>
</target>
Expand Down
2 changes: 1 addition & 1 deletion ant/docs/examples/classpath/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
-->
To run this example:
- Have [Apache Ant](https://ant.apache.org) installed
- Issue `ant reveng` from a command-line window
- Issue `ant` from a command-line window
35 changes: 5 additions & 30 deletions ant/docs/examples/classpath/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="classpath" default="reveng">

<property name="hibernate-tools.version" value="7.0.0.CR1"/>
<property name="jdbc-driver.org" value="com.h2database"/>
<property name="jdbc-driver.module" value="h2"/>
<property name="jdbc-driver.version" value="2.3.232"/>

<ivy:cachepath
organisation="org.hibernate.tool"
module="hibernate-tools-ant"
revision="${hibernate-tools.version}"
pathid="hibernate-tools.path"
inline="true"/>
<ivy:cachepath
organisation="${jdbc-driver.org}"
module="${jdbc-driver.module}"
revision="${jdbc-driver.version}"
pathid="jdbc-driver.path"
inline="true"/>

<path id="classpath">
<path refid="hibernate-tools.path"/>
<path refid="jdbc-driver.path"/>
</path>

<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath" />
<!-- Include the 'hibernatetool' task definition from the file '../common/included.xml' -->
<include file="../common/included.xml"/>

<target name="clean">
<!-- Delete the folder 'additional/classes if it exists -->
<delete dir="additional/classes"/>
</target>

Expand All @@ -59,8 +35,7 @@

<target name="reveng" depends="compile">
<hibernatetool destdir="generated-sources">
<!-- The classpath to be used by the 'hibernatetool' task
to look up additional classes or resources -->
<!-- The classpath to be used by the 'hibernatetool' task to look up additional classes or resources -->
<classpath>
<pathelement location="additional/classes"/>
</classpath>
Expand Down
46 changes: 46 additions & 0 deletions ant/docs/examples/common/included.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
~ Copyright 2004 - 2025 Red Hat, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" basis,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="common" xmlns:ivy="antlib:org.apache.ivy.ant">

<property name="hibernate-tools.version" value="7.0.0.CR1"/>
<property name="jdbc-driver.org" value="com.h2database"/>
<property name="jdbc-driver.module" value="h2"/>
<property name="jdbc-driver.version" value="2.3.232"/>

<ivy:cachepath
organisation="org.hibernate.tool"
module="hibernate-tools-ant"
revision="${hibernate-tools.version}"
pathid="hibernate-tools.path"
inline="true"/>
<ivy:cachepath
organisation="${jdbc-driver.org}"
module="${jdbc-driver.module}"
revision="${jdbc-driver.version}"
pathid="jdbc-driver.path"
inline="true"/>

<path id="classpath">
<path refid="hibernate-tools.path"/>
<path refid="jdbc-driver.path"/>
</path>

<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath" />

</project>