source: release-kits/shared/ant-tasks/svnant/doc/conditions.html@ 17129

Last change on this file since 17129 was 17129, checked in by oranfry, 16 years ago

a newer version of svnant

File size: 7.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns:ant="http://www.fiset.ca/ant-docs/v1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"/>
6<title>Svn Conditions</title>
7<META HTTP-EQUIV="Content-Language" CONTENT="en-us"/>
8<style type="text/css">
9
10 body {
11 font: 80% Verdana, Arial, Helvetica, sans-serif;
12 margin: 5px; padding: 0;
13 /* background: rgb(95%,95%,80%); */
14 color: black;
15 }
16 h1 {
17 font-size: 200%; letter-spacing: 3px;
18 margin-bottom: 1em;
19 padding: 0.66em 0 0.33em 1em;
20 background: rgb(85%,85%,70%);
21 }
22 h2 {
23 background: rgb(90%,90%,80%);
24 }
25 h3 {
26 background-color: rgb(95%,95%,85%);
27 }
28 .sample {
29 font-family: Courier, "Courier New", monospace;
30 background-color: #f3f1f4;
31 }
32 div.sample {
33 margin-left: 10px;
34 margin-right: 10px;
35 padding-top: 3px;
36 padding-bottom: 3px;
37 padding-left: 3px;
38 padding-right: 3px;
39 border:1px dashed black;
40 width: 80%;
41 }
42 table.params {
43 width: 80%;
44 border: 1px solid gray;
45 margin-bottom:1em;
46 }
47 th.params, td.params {
48 padding: 0 0.5em;
49 border-left: 1px solid #DDD;
50 border-bottom: 1px solid #DDD;
51 font: 70%
52 }
53 th.params {
54
55 }
56 table.toc {
57 width: 80%;
58 border: 1px solid gray;
59 margin-bottom:1em;
60 }
61 td.toc {
62 padding: 0 0.5em;
63 border: none
64 font: 70%
65 }
66 table.type {
67 width: 80%;
68 border: none;
69 margin-bottom:1em;
70 }
71 th.type, td.type {
72 text-align: left;
73 padding: 0 0.5em;
74 border: none
75 font: 70%
76 }
77 th.type {
78 font-weight: bold;
79 }
80
81 </style>
82</head>
83<body lang="en-US" dir="LTR">
84<h1>Svn Conditions</h1>
85<h2>Table of Content</h2>
86<table class="toc">
87<tbody class="toc">
88<tr class="toc">
89<td class="toc">
90<a href="#svnExists">svnExists</a>
91</td>
92<td class="toc">Ant condition that returns true if an element exists in the repository</td>
93</tr>
94</tbody>
95</table>
96<h2>Introduction</h2>
97<ant:introduction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
98 <p>
99 This document describes the conditions offered in svnant. To use those conditions,
100 you must first obtain a copy of svnant.jar, add it to the classpath of your ant project
101 and define the types. Fortunately, there is a resource file, within the distributed JAR file,
102 and all those steps can be accomplished with the following code:
103 <div class="sample">
104<pre class="sample">
105
106&lt;path id="svnant.classpath"&gt;
107 &lt;pathelement location="${svnant.dir}/lib/svnant.jar" /&gt;
108 &lt;pathelement location="${svnant.dir}/lib/svnClientAdapter.jar" /&gt;
109&lt;/path&gt;
110
111&lt;typedef resource="svntypes.xml" classpathref="project.classpath"/&gt;
112
113 </pre>
114</div>
115 </p>
116 <p>
117 If you are upgrading from an earlier version of svnant, and the following line was used
118 in your <i>build.xml</i> file, then replace it with the ones above.
119 <div class="sample">
120<pre class="sample">
121
122&lt;taskdef resource="svntask.properties" classpathref="svnant.classpath"/&gt;
123
124 </pre>
125</div>
126 </p>
127 <h3>
128<a name="bindings">Bindings</a>
129</h3>
130 <p>
131 All conditions offer two parameters: <b>javahl</b> and <b>svnkit</b>. Those parameters
132 are booleans, which means their values can be set to either <b>true</b> or <b>false</b>.
133 If not specified, those parameters are assumed to be set (true). These two parameters are used
134 to select which client is used to access Subversion.
135 </p>
136 <p>
137 There are three clients used by svnant to access Subversion:
138 <ul>
139 <li>JavaHL;</li>
140 <li>SVNKit; and,</li>
141 <li>Command Line Interface.</li>
142 </ul>
143 To better understand the difference between those three clients, please refer to
144 documentation on <b>svnClientAdapter.jar</b>.
145 </p>
146 <p>
147 The property <b>javahl</b> is considered only if the javahl libraries are available. Similarly,
148 the property <b>svnkit</b> is considered only if SVNKit is present. Finally, <b>javahl</b>
149 takes precedence over <b>svnkit</b>.
150 </p>
151 <p>
152 To better illustrate the previous paragraph, use the following steps:
153 <ol>
154 <li>If <b>javahl</b> is <i>true</i> and JavaHL bindings are available, then JavaHL is used.</li>
155 <li>If <b>svnkit</b> is <i>true</i> and SVNKit is present, then SVNKit is used.</li>
156 <li>If the two previous tests failed, for any reason, then the Command Line Interface is used.</li>
157 </ol>
158 </p>
159 </ant:introduction>
160<h1>
161<a name="">svnExists</a>
162</h1>
163<p>Ant condition that returns true if an element exists in the repository</p>
164<table class="type">
165<tbody class="type">
166<tr class="type">
167<th class="type">Implementation:</th>
168<td class="type">org.tigris.subclipse.svnant.conditions.Exists</td>
169</tr>
170</tbody>
171</table>
172<h2>Parameters</h2>
173<table class="params">
174<tr class="params">
175<th class="params">Attribute</th>
176<th class="params">Description</th>
177<th class="params">Required</th>
178</tr>
179<tr class="params">
180<td class="params">target</td>
181<td class="params">
182<ant:description xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
183 File name or URL to the element to be queried during the condition.
184 </ant:description>
185</td>
186<td class="params">
187<ant:required xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
188 Yes
189 </ant:required>
190</td>
191</tr>
192<tr class="params">
193<td class="params">javahl</td>
194<td class="params">
195<ant:description xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
196 If set, instructs the use of JavaHL bindings, if available.
197 Set to <b>false</b> to use command line client interface to subversion.
198 Defaults to true. See <a href="#bindings">note</a> for more details.
199 </ant:description>
200</td>
201<td class="params">
202<ant:required xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
203 No
204 </ant:required>
205</td>
206</tr>
207<tr class="params">
208<td class="params">svnkit</td>
209<td class="params">
210<ant:description xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
211 If set, instructs the use of SVNKit bindings, if available.
212 Set to <b>false</b> to use command line client interface to subversion.
213 Defaults to true. See <a href="#bindings">note</a> for more details.
214 </ant:description>
215</td>
216<td class="params">
217<ant:required xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
218 No
219 </ant:required>
220</td>
221</tr>
222</table>
223<h2>Nested Types</h2>No nested types defined for this type.<h2>Description</h2>
224 <p xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
225 This is a custom condition, as defined in the Ant documentation. A custom
226 condition must be employed in conjunction with a &lt;Condition&gt; task
227 to set a property.
228 </p>
229 <p xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
230 This custom condition is used to determine if an element exists in the repository. The condition returns
231 true if the element is known to te repository. It uses a process similar to "svn info"
232 to determine the existence of an element. If "svn info" can return information
233 about a file or a directory, then the svnExists condition should return true for
234 such file or directory.
235 </p>
236 <p xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
237 Example: determine if there exist a "build.xml" file for a project
238 <div class="sample">
239<pre class="sample">
240
241&lt;condition
242 property="fileExists"
243 value="true"
244 else="false"
245 &gt;
246 &lt;svnExists javahl="${javahl}" svnkit="${svnkit}" target="http://svn.mycompany.com/project/trunk/build.xml"/&gt;
247&lt;/condition&gt;
248&lt;echo&gt;fileExists: ${fileExists}&lt;/echo&gt;
249
250 </pre>
251</div>
252 </p>
253 </body>
254</html>
Note: See TracBrowser for help on using the repository browser.