Hi all,
I'm trying to use the hbm2ddl nant task. I would like to auto-generate DDL script based on my mapping files.
Here is my Nant build file :
Code:
<project name="DDL Generator" default="generateDDLScript" basedir="." xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<loadtasks assembly="C:\Program Files\NHibernate\bin\net-2.0\NHibernate.Tasks.dll"/>
<target name="generateDDLScript">
<hbm2ddl connectionprovider="NHibernate.Connection.DriverConnectionProvider"
dialect="NHibernate.Dialect.MsSql2005Dialect"
connectiondriverclass="NHibernate.Driver.SqlClientDriver"
connectionstring="data source=.\SQLEXPRESS;database=Test;Trusted_Connection=Yes;"
droponly="false"
exportonly="true"
delimiter=" GO "
outputtoconsole="false"
formatnice="true"
outputfilename=".\Test.sql">
<assemblies>
<include name=".\MyTestProject.Dal.dll"></include>
</assemblies>
</hbm2ddl>
</target>
</project>
(Note : the mapping files are embedded as resources in the MyTestProject.Dal.dll assembly)
When I launch the build, here are the console traces :
Code:
NAnt 0.85 (Build 0.85.2478.0; release; 14/10/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Temp/DDL.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: generateDDLScript
[loadtasks] Scanning assembly "NHibernate.Tasks" for extensions.
generateDDLScript:
[hbm2ddl] Adding assembly file C:\Temp\MyTestProject.Dal.dll
[hbm2ddl] Successful DDL schema output: .\Test.sql
BUILD SUCCEEDED
Total time: 0.3 seconds.
The result is an empty Test.sql file...
Any idea what's wrong here ?
Thanks by advance,
Nicolas