blob: 6f3641e826df58944e4c7f58b6e020e2fde3de15 [file] [log] [blame]
---
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
title: Ant Tasks
url: /docs/2.0/ant-tasks.html
layout: docs_legacy
---
<P>Cayenne ships with Ant tasks that provide Ant frontend to a number of useful operations in Cayenne. The following tasks are included:</P>
<UL>
<LI><B><A href="cgen.html" title="cgen">cgen</A></B> - Java class generator</LI>
<LI><B><A href="cdbgen.html" title="cdbgen">cdbgen</A></B> - Database schema generator</LI>
<LI><B><A href="cdeploy.html" title="cdeploy">cdeploy</A></B> - Deployment configurator</LI>
<LI><B><A href="cdataport.html" title="cdataport">cdataport</A></B> - Data porting tool.</LI>
</UL>
<H3><A name="AntTasks-ImportingCayenneTasksinbuild.xml"></A>Importing Cayenne Tasks in build.xml</H3>
<P>Cayenne tasks above can be imported individually using Ant taskdef, as described in each task documentation page. However the users of Ant 1.6 and newer can take advantage of Antlib Ant feature. <A href="http://ant.apache.org/manual/CoreTypes/antlib.html" class="external-link" rel="nofollow">Antlib</A> allows 3rd party tasks and types to be defined easily. Cayenne has an embedded antlib.xml descriptor file in the package <TT>org.apache.cayenne.tools</TT>. All of Cayenne's Ant tasks can be defined at once using the following definition in your Ant build file:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-xml">
<SPAN class="code-tag">&lt;typedef resource=<SPAN class="code-quote">&quot;org/apache/cayenne/tools/antlib.xml&quot;</SPAN>&gt;</SPAN>
<SPAN class="code-tag">&lt;classpath refid=<SPAN class="code-quote">&quot;classpath&quot;</SPAN>/&gt;</SPAN>
<SPAN class="code-tag">&lt;/typedef&gt;</SPAN>
</PRE>
</DIV></DIV>
<P>When using the Antlib construct, omit the <TT>&lt;taskdef&gt;</TT> elements shown in the examples of each task, as the antlib.xml file defines all of the Cayenne Ant tasks. </P>
<H3><A name="AntTasks-Sections"></A>Sections</H3>
<OL>
<LI><A href="cgen.html" title="cgen">cgen</A></LI>
<LI><A href="cdbgen.html" title="cdbgen">cdbgen</A></LI>
<LI><A href="cdeploy.html" title="cdeploy">cdeploy</A></LI>
<LI><A href="cdataport.html" title="cdataport">cdataport</A></LI>
</OL>