BT

Integrate OpenAccess ORM with NAnt using Clean, Build and Enhance Targets

by Anand Narayanaswamy on Sep 04, 2013 |

In order to Integrate OpenAccess ORM, which is Telerik's free object relational mapping tool, with NAnt, you need to make use of NAnt build definition which includes several targets such as clean, build and enhance. These targets will be used to automate the build process for the given OpenAccess ORM domain model.

The clean target is optional and used to clean up the build folder.

<target name="clean">

The implementation looks like as shown below

<include name="${build.dir}/*.*" />

On the other hand, Build target first performs source code building as shown below

<target name="build" depends="clean">

It then embeds the rlinq file as a resource and defines the required references

<include name="${source.dir}/MyModel.rlinq" />

<references>
 <include name="System" />
 <include name="System.Core" />
 <include name="System.Data" />
 <include name="Lib/Telerik.OpenAccess.dll" />
 <include name="Lib/Telerik.OpenAccess.35.Extensions.dll" />
</references>


Finally, it copies the required OA assemblies as shown below

<copy todir="${build.dir}">
 <fileset basedir="${lib.dir}">
  <include name="Telerik.OpenAccess.dll" />
  <include name="Telerik.OpenAccess.35.Extensions.dll" />
 </fileset>
</copy>

The Enhance target runs the OpenAccess ORM enhancer over the built project using the rlinq file as a metadata source as shown below

<target name="enhance" depends="build">
 <exec program="${enhancer.file}">
  <arg value="-assembly:"${build.file}" -xmlMapping:${source.dir}/MyModel.rlinq"/>
 </exec>
</target>

As you can notice, the above code make use of XML mapping.

"There can be scenarios where the model is defined using attributes or fluent mapping. It is possible to combine all of the mapping types in one OpenAccess ORM project," says Damyan Bogoev, Senior Software Developer, OpenAccess ORM Team, Telerik.

OpenAccess ORM enables you to generate data access layer for your applications by creating the data model.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT