ant.html revision cfead78069f3dc32998dc118ee08cab3867acea2
1<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
5<meta http-equiv="content-style-type" content="text/css">
6<link rel="stylesheet" type="text/css" href="style.css">
7<title>Ant Task</title>
8<script type="text/javascript" language="JavaScript">
9<!--
10if (window.self==window.top)
11  window.top.location.replace("/index.html#"+window.location.pathname+window.location.hash);
12else {
13  var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
14  if (window.top.location.hash!=hash)
15    window.top.location.hash=hash;
16}
17//-->
18</script>
19</head>
20<body>
21
22<h2>Ant Task</h2>
23
24<b>ProGuard</b> can be run as a task in the Java-based build tool Ant (version
251.6.0 or higher).
26<p>
27
28Before you can use the <code>proguard</code> task, you have to tell Ant about
29this new task. The easiest way is to add the following line to your
30<code>build.xml</code> file:
31<p>
32
33<pre>
34&lt;taskdef resource="proguard/ant/task.properties"
35         classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
36</pre>
37<p>
38
39Please make sure the class path is set correctly for your system.
40<p>
41
42There are three ways to configure the ProGuard task: using an external
43configuration file, using embedded ProGuard configuration options, or using
44the equivalent XML configuration tags. These three ways can be combined,
45depending on practical circumstances and personal preference.
46<p>
47
48<h3>1. An external ProGuard configuration file</h3>
49
50The simplest way to use the ProGuard task in an Ant build file is to keep your
51ProGuard configuration file, and include it from Ant. You can include your
52ProGuard configuration file by setting
53the <a href="#configuration_attribute"><code>configuration</code></a>
54attribute of your
55<code>proguard</code> task. Your ant build file will then look like this:
56<p>
57
58<pre>
59&lt;taskdef resource="proguard/ant/task.properties"
60         classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
61&lt;proguard configuration="myconfigfile.pro"/&gt;
62</pre>
63<p>
64
65This is a convenient option if you prefer ProGuard's configuration style over
66XML, if you want to keep your build file small, or if you have to share your
67configuration with developers who don't use Ant.
68<p>
69
70<h3>2. Embedded ProGuard configuration options</h3>
71
72Instead of keeping an external ProGuard configuration file, you can also copy
73the contents of the file into the nested text of the <code>proguard</code> task
74(the PCDATA area). Your Ant build file will then look like this:
75<p>
76
77<pre>
78&lt;taskdef resource="proguard/ant/task.properties"
79         classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
80&lt;proguard&gt;
81  -libraryjars ${java.home}/lib/rt.jar
82  -injars      in.jar
83  -outjars     out.jar
84
85  -keepclasseswithmembers public class * {
86      public static void main(java.lang.String[]);
87  }
88&lt;/proguard&gt;
89</pre>
90<p>
91
92Some minor syntactical changes are required in order to conform with the XML
93standard.
94<p>
95
96Firstly, the <code>#</code> character cannot be used for comments in an XML
97file. Comments must be enclosed by an opening <code>&lt;!--</code> and a
98closing <code>--&gt;</code>. All occurrences of the <code>#</code> character
99can be removed.
100<p>
101
102Secondly, the use of <code>&lt;</code> and <code>&gt;</code> characters would
103upset the structure of the XML build file. Environment variables are now
104enclosed by an opening <code>${</code> and a closing <code>}</code>. This
105syntax also allows you to use Ant properties within the ProGuard
106configuration. Other occurrences of <code>&lt;</code> and <code>&gt;</code>
107have to be encoded as <code>&amp;lt;</code> and <code>&amp;gt;</code>.
108<p>
109
110<h3>3. XML configuration tags</h3>
111
112If you really prefer a full-blown XML configuration, you can replace the
113ProGuard configuration options by XML configuration tags. The resulting
114configuration will be equivalent, but much more verbose and difficult to read,
115as XML goes. The remainder of this page presents the supported tags. For a
116more extensive discussion of their meaning, please consult the traditional <a
117href="usage.html">Usage</a> section. You can find some sample configuration
118files in the <code>examples/ant</code> directory of the ProGuard distribution.
119<p>
120
121<h2><a name="proguard">Task Attributes and Nested Elements</a></h2>
122
123The <code><b>&lt;proguard&gt;</b></code> task and the
124<code><b>&lt;proguardconfiguration&gt;</b></code> task can have the following
125attributes (only for <code>&lt;proguard&gt;</code>) and nested
126elements:
127
128<dl>
129
130<dt><a name="configuration_attribute"><code><b>configuration</b></code></a>
131    = "<i>filename</i>"</dt>
132<dd>Read and merge options from the given ProGuard-style configuration
133    file. Note: for reading XML-style configurations, use the <a
134    href="#configuration_element"><code>configuration</code></a>
135    <i>element</i>.</dd>
136
137<dt><a href="usage.html#skipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a>
138    = "<i>boolean</i>"
139    (default = false)</dt>
140<dd>Ignore non-public library classes.</dd>
141
142<dt><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>skipnonpubliclibraryclassmembers</b></code></a>
143    = "<i>boolean</i>"
144    (default = true)</dt>
145<dd>Ignore package visible library class members.</dd>
146
147<dt><a href="usage.html#target"><code><b>target</b></code></a>
148    = "<i>version</i>"
149    (default = none)</dt>
150<dd>Set the given version number in the processed classes.</dd>
151
152<dt><a href="usage.html#forceprocessing"><code><b>forceprocessing</b></code></a>
153    = "<i>boolean</i>"
154    (default = false)</dt>
155<dd>Process the input, even if the output seems up to date.</dd>
156
157<dt><a href="usage.html#printseeds"><code><b>printseeds</b></code></a>
158    = "<i>boolean or filename</i>"
159    (default = false)</dt>
160<dd>List classes and class members matched by the various <code>keep</code>
161    commands, to the standard output or to the given file.</dd>
162
163<dt><a href="usage.html#dontshrink"><code><b>shrink</b></code></a>
164    = "<i>boolean</i>"
165    (default = true)</dt>
166<dd>Shrink the input class files.</dd>
167
168<dt><a href="usage.html#printusage"><code><b>printusage</b></code></a>
169    = "<i>boolean or filename</i>"
170    (default = false)</dt>
171<dd>List dead code of the input class files, to the standard output or to the
172    given file.</dd>
173
174<dt><a href="usage.html#dontoptimize"><code><b>optimize</b></code></a>
175    = "<i>boolean</i>"
176    (default = true)</dt>
177<dd>Optimize the input class files.</dd>
178
179<dt><a href="usage.html#optimizationpasses"><code><b>optimizationpasses</b></code></a>
180    = "<i>n</i>"
181    (default = 1)</dt>
182<dd>The number of optimization passes to be performed.</dd>
183
184<dt><a href="usage.html#allowaccessmodification"><code><b>allowaccessmodification</b></code></a>
185    = "<i>boolean</i>"
186    (default = false)</dt>
187<dd>Allow the access modifiers of classes and class members to be modified,
188    while optimizing.</dd>
189
190<dt><a href="usage.html#mergeinterfacesaggressively"><code><b>mergeinterfacesaggressively</b></code></a>
191    = "<i>boolean</i>"
192    (default = false)</dt>
193<dd>Allow any interfaces to be merged, while optimizing.</dd>
194
195<dt><a href="usage.html#dontobfuscate"><code><b>obfuscate</b></code></a>
196    = "<i>boolean</i>"
197   (default = true)</dt>
198<dd>Obfuscate the input class files.</dd>
199
200<dt><a href="usage.html#printmapping"><code><b>printmapping</b></code></a>
201    = "<i>boolean or filename</i>"
202    (default = false)</dt>
203<dd>Print the mapping from old names to new names for classes and class members
204    that have been renamed, to the standard output or to the given file.</dd>
205
206<dt><a href="usage.html#applymapping"><code><b>applymapping</b></code></a>
207    = "<i>filename</i>"
208    (default = none)</dt>
209<dd>Reuse the given mapping, for incremental obfuscation.</dd>
210
211<dt><a href="usage.html#obfuscationdictionary"><code><b>obfuscationdictionary</b></code></a>
212    = "<i>filename</i>"
213    (default = none)</dt>
214<dd>Use the words in the given text file as obfuscated field names and method
215    names.</dd>
216
217<dt><a href="usage.html#classobfuscationdictionary"><code><b>classobfuscationdictionary</b></code></a>
218    = "<i>filename</i>"
219    (default = none)</dt>
220<dd>Use the words in the given text file as obfuscated class names.</dd>
221
222<dt><a href="usage.html#packageobfuscationdictionary"><code><b>packageobfuscationdictionary</b></code></a>
223    = "<i>filename</i>"
224    (default = none)</dt>
225<dd>Use the words in the given text file as obfuscated package names.</dd>
226
227<dt><a href="usage.html#overloadaggressively"><code><b>overloadaggressively</b></code></a>
228    = "<i>boolean</i>"
229    (default = false)</dt>
230<dd>Apply aggressive overloading while obfuscating.</dd>
231
232<dt><a href="usage.html#useuniqueclassmembernames"><code><b>useuniqueclassmembernames</b></code></a>
233    = "<i>boolean</i>"
234    (default = false)</dt>
235<dd>Ensure uniform obfuscated class member names for subsequent incremental
236    obfuscation.</dd>
237
238<dt><a href="usage.html#dontusemixedcaseclassnames"><code><b>usemixedcaseclassnames</b></code></a>
239    = "<i>boolean</i>"
240    (default = true)</dt>
241<dd>Generate mixed-case class names while obfuscating.</dd>
242
243<dt><a href="usage.html#flattenpackagehierarchy"><code><b>flattenpackagehierarchy</b></code></a>
244    = "<i>package_name</i>"
245    (default = none)</dt>
246<dd>Repackage all packages that are renamed into the single given parent
247    package.</dd>
248
249<dt><a href="usage.html#repackageclasses"><code><b>repackageclasses</b></code></a>
250    = "<i>package_name</i>"
251    (default = none)</dt>
252<dd>Repackage all class files that are renamed into the single given
253    package.</dd>
254
255<dt><a href="usage.html#keepparameternames"><code><b>keepparameternames</b></code></a>
256    = "<i>boolean</i>"
257   (default = false)</dt>
258<dd>Keep the parameter names and types of methods that are kept.</dd>
259
260<dt><a href="usage.html#renamesourcefileattribute"><code><b>renamesourcefileattribute</b></code></a>
261    = "<i>string</i>"
262    (default = none)</dt>
263<dd>Put the given constant string in the <code>SourceFile</code>
264    attributes.</dd>
265
266<dt><a href="usage.html#dontpreverify"><code><b>preverify</b></code></a>
267    = "<i>boolean</i>"
268    (default = true)</dt>
269<dd>Preverify the processed class files if they are targeted at Java Micro
270    Edition or at Java 6 or higher.</dd>
271
272<dt><a href="usage.html#microedition"><code><b>microedition</b></code></a>
273    = "<i>boolean</i>"
274    (default = false)</dt>
275<dd>Targets the processed class files at Java Micro Edition.</dd>
276
277<dt><a href="usage.html#verbose"><code><b>verbose</b></code></a>
278    = "<i>boolean</i>"
279    (default = false)</dt>
280<dd>Write out some more information during processing.</dd>
281
282<dt><a href="usage.html#dontnote"><code><b>note</b></code></a>
283    = "<i>boolean</i>"
284   (default = true)</dt>
285<dd>Print notes about potential mistakes or omissions in the configuration.
286    Use the nested element <a href="#dontnote">dontnote</a> for more
287    fine-grained control.</dd>
288
289<dt><a href="usage.html#dontwarn"><code><b>warn</b></code></a>
290    = "<i>boolean</i>"
291    (default = true)</dt>
292<dd>Print warnings about unresolved references. Use the nested
293    element <a href="#dontwarn">dontwarn</a> for more fine-grained
294    control. <i>Only use this option if you know what you're doing!</i></dd>
295
296<dt><a href="usage.html#ignorewarnings"><code><b>ignorewarnings</b></code></a>
297    = "<i>boolean</i>"
298    (default = false)</dt>
299<dd>Print warnings about unresolved references, but continue processing
300    anyhow. <i>Only use this option if you know what you're doing!</i></dd>
301
302<dt><a href="usage.html#printconfiguration"><code><b>printconfiguration</b></code></a>
303    = "<i>boolean or filename</i>"
304    (default = false)</dt>
305<dd>Write out the entire configuration in traditional ProGuard style, to the
306    standard output or to the given file. Useful to replace unreadable
307    XML configurations.</dd>
308
309<dt><a href="usage.html#dump"><code><b>dump</b></code></a>
310    = "<i>boolean or filename</i>"
311    (default = false)</dt>
312<dd>Write out the internal structure of the processed class files, to the
313    standard output or to the given file.</dd>
314
315<dt><a href="usage.html#injars"><code><b>&lt;injar</b></code></a>
316    <a href="#classpath"><i>class_path</i></a>
317    <code><b>/&gt;</b></code></dt>
318<dd>Specifies the program jars (or wars, ears, zips, or directories).</dd>
319
320<dt><a href="usage.html#outjars"><code><b>&lt;outjar</b></code></a>
321    <a href="#classpath"><i>class_path</i></a>
322    <code><b>/&gt;</b></code></dt>
323<dd>Specifies the name of the output jars (or wars, ears, zips, or
324    directories).</dd>
325
326<dt><a href="usage.html#libraryjars"><code><b>&lt;libraryjar</b></code></a>
327    <a href="#classpath"><i>class_path</i></a>
328    <code><b>/&gt;</b></code></dt>
329<dd>Specifies the library jars (or wars, ears, zips, or directories).</dd>
330
331<dt><a href="usage.html#keepdirectories"><code><b>&lt;keepdirectory name = </b></code></a>"<i>directory_name</i>"
332    <code><b>/&gt;</b></code><br/>
333    <a href="usage.html#keepdirectories"><code><b>&lt;keepdirectories filter = </b></code></a>"<a href="usage.html#filefilters"><i>directory_filter</i></a>"
334    <code><b>/&gt;</b></code></dt>
335<dd>Keep the specified directories in the output jars (or wars, ears, zips, or
336    directories).</dd>
337
338<dt><a href="usage.html#keep"><code><b>&lt;keep</b></code></a>
339    <a href="#keepmodifier"><i>modifiers</i></a>
340    <a href="#classspecification"><i>class_specification</i></a>
341    <code><b>&gt;</b></code>
342    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
343    <code><b>&lt;/keep&gt;</b></code></dt>
344<dd>Preserve the specified classes <i>and</i> class members.</dd>
345
346<dt><a href="usage.html#keepclassmembers"><code><b>&lt;keepclassmembers</b></code></a>
347    <a href="#keepmodifier"><i>modifiers</i></a>
348    <a href="#classspecification"><i>class_specification</i></a>
349    <code><b>&gt;</b></code>
350    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
351    <code><b>&lt;/keepclassmembers&gt;</b></code></dt>
352<dd>Preserve the specified class members, if their classes are preserved as
353    well.</dd>
354
355<dt><a href="usage.html#keepclasseswithmembers"><code><b>&lt;keepclasseswithmembers</b></code></a>
356    <a href="#keepmodifier"><i>modifiers</i></a>
357    <a href="#classspecification"><i>class_specification</i></a>
358    <code><b>&gt;</b></code>
359    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
360    <code><b>&lt;/keepclasseswithmembers&gt;</b></code></dt>
361<dd>Preserve the specified classes <i>and</i> class members, if all of the
362    specified class members are present.</dd>
363
364<dt><a href="usage.html#keepnames"><code><b>&lt;keepnames</b></code></a>
365    <a href="#classspecification"><i>class_specification</i></a>
366    <code><b>&gt;</b></code>
367    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
368    <code><b>&lt;/keepnames&gt;</b></code></dt>
369<dd>Preserve the names of the specified classes <i>and</i> class members (if
370    they aren't removed in the shrinking step).</dd>
371
372<dt><a href="usage.html#keepclassmembernames"><code><b>&lt;keepclassmembernames</b></code></a>
373    <a href="#classspecification"><i>class_specification</i></a>
374    <code><b>&gt;</b></code>
375    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
376    <code><b>&lt;/keepclassmembernames&gt;</b></code></dt>
377<dd>Preserve the names of the specified class members (if they aren't removed
378    in the shrinking step).</dd>
379
380<dt><a href="usage.html#keepclasseswithmembernames"><code><b>&lt;keepclasseswithmembernames</b></code></a>
381    <a href="#classspecification"><i>class_specification</i></a>
382    <code><b>&gt;</b></code>
383    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
384    <code><b>&lt;/keepclasseswithmembernames&gt;</b></code></dt>
385<dd>Preserve the names of the specified classes <i>and</i> class members, if
386    all of the specified class members are present (after the shrinking
387    step).</dd>
388
389<dt><a href="usage.html#whyareyoukeeping"><code><b>&lt;whyareyoukeeping</b></code></a>
390    <a href="#classspecification"><i>class_specification</i></a>
391    <code><b>&gt;</b></code>
392    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
393    <code><b>&lt;/whyareyoukeeping&gt;</b></code></dt>
394<dd>Print details on why the given classes and class members are being kept in
395    the shrinking step.</dd>
396
397<dt><a href="usage.html#assumenosideeffects"><code><b>&lt;assumenosideeffects</b></code></a>
398    <a href="#classspecification"><i>class_specification</i></a>
399    <code><b>&gt;</b></code>
400    <a href="#classmemberspecification"><i>class_member_specifications</i></a>
401    <code><b>&lt;/assumenosideeffects&gt;</b></code></dt>
402<dd>Assume that the specified methods don't have any side effects, while
403    optimizing. <i>Only use this option if you know what you're
404    doing!</i></dd>
405
406<dt><a href="usage.html#optimizations"><code><b>&lt;optimization name = </b></code></a>"<a href="optimizations.html"><i>optimization_name</i></a>"
407    <code><b>/&gt;</b></code><br/>
408    <a href="usage.html#optimizations"><code><b>&lt;optimizations filter = </b></code></a>""<a href="optimizations.html"><i>optimization_filter</i></a>"
409    <code><b>/&gt;</b></code></dt>
410<dd>Perform only the specified optimizations.</dd>
411
412<dt><a href="usage.html#keeppackagenames"><code><b>&lt;keeppackagename name = </b></code></a>"<i>package_name</i>"
413    <code><b>/&gt;</b></code><br/>
414    <a href="usage.html#keeppackagenames"><code><b>&lt;keeppackagenames filter = </b></code></a>"<a href="usage.html#filters"><i>package_filter</i></a>"
415    <code><b>/&gt;</b></code></dt>
416<dd>Keep the specified package names from being obfuscated. If no name is
417    given, all package names are preserved.</dd>
418
419<dt><a href="usage.html#keepattributes"><code><b>&lt;keepattribute name = </b></code></a>"<i>attribute_name</i>"
420    <code><b>/&gt;</b></code><br/>
421    <a href="usage.html#keepattributes"><code><b>&lt;keepattributes filter = </b></code></a>"<a href="usage.html#filters"><i>attribute_filter</i></a>"
422    <code><b>/&gt;</b></code></dt>
423<dd>Preserve the specified optional Java bytecode attributes, with optional
424    wildcards. If no name is given, all attributes are preserved.</dd>
425
426<dt><a href="usage.html#adaptclassstrings"><code><b>&lt;adaptclassstrings filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
427    <code><b>/&gt;</b></code></dt>
428<dd>Adapt string constants in the specified classes, based on the obfuscated
429    names of any corresponding classes.</dd>
430
431<dt><a href="usage.html#adaptresourcefilenames"><code><b>&lt;adaptresourcefilenames filter = </b></code></a>"<a href="usage.html#filefilters"><i>file_filter</i></a>"
432    <code><b>/&gt;</b></code></dt>
433<dd>Rename the specified resource files, based on the obfuscated names of the
434    corresponding class files.</dd>
435
436<dt><a href="usage.html#adaptresourcefilecontents"><code><b>&lt;adaptresourcefilecontents filter = </b></code></a>"<a href="usage.html#filefilters"><i>file_filter</i></a>"
437    <code><b>/&gt;</b></code></dt>
438<dd>Update the contents of the specified resource files, based on the
439    obfuscated names of the processed classes.</dd>
440
441<dt><a name="dontnote" />
442    <a href="usage.html#dontnote"><code><b>&lt;dontnote filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
443    <code><b>/&gt;</b></code></dt>
444<dd>Don't print notes about classes matching the specified class name
445    filter.</dd>
446
447<dt><a name="dontwarn" />
448    <a href="usage.html#dontwarn"><code><b>&lt;dontwarn filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
449    <code><b>/&gt;</b></code></dt>
450<dd>Don't print warnings about classes matching the specified class name
451    filter. <i>Only use this option if you know what you're doing!</i></dd>
452
453<dt><a name="configuration_element"><code><b>&lt;configuration refid = </b></code></a>"<i>ref_id</i>"
454    <code><b>/&gt;</b></code></dt>
455<dd>Includes the configuration specified in the
456    <code>&lt;proguardconfiguration&gt;</code> task (or
457    <code>&lt;proguard&gt;</code> task) with the attribute <code>id</code> =
458    "<i>ref_id</i>". Note that only the nested elements of this configuration
459    are considered, not the attributes. Also note: for reading ProGuard-style
460    configuration files, use the <a
461    href="#configuration_attribute"><code>configuration</code></a>
462    <i>attribute</i>.</dd>
463
464</dl>
465
466<h2><a name="classpath">Class Path Attributes and Nested Elements</a></h2>
467
468The jar tags are path tags, so they can have any of the path attributes (or
469nested elements). The most common attributes are:
470
471<dl>
472
473<dt><code><b>path</b></code> = "<i>path</i>"</dt>
474<dd>The names of the jars (or wars, ears, zips, or directories), separated by
475    the path separator.</dd>
476
477<dt><code><b>location</b></code> = "<i>name</i>" (or <code><b>file</b></code>
478    = "<i>name</i>", or <code><b>dir</b></code> = "<i>name</i>", or
479    <code><b>name</b></code> = "<i>name</i>")</dt>
480<dd>Alternatively, the name of a single jar (or war, ear, zip, or
481    directory).</dd>
482
483<dt><code><b>refid</b></code> = "<i>ref_id</i>"</dt>
484<dd>Alternatively, a reference to the path or file set with the attribute
485    <code>id</code> = "<i>ref_id</i>".</dd>
486
487</dl>
488
489In addition, the jar tags can have ProGuard-style filter attributes:
490
491<dl>
492
493<dt><code><b>filter</b></code> =
494    "<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
495<dd>An optional filter for all class file names and resource file names that
496    are encountered.</dd>
497
498<dt><code><b>jarfilter</b></code> =
499    "<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
500<dd>An optional filter for all jar names that are encountered.</dd>
501
502<dt><code><b>warfilter</b></code> =
503    "<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
504<dd>An optional filter for all war names that are encountered.</dd>
505
506<dt><code><b>earfilter</b></code> =
507    "<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
508<dd>An optional filter for all ear names that are encountered.</dd>
509
510<dt><code><b>zipfilter</b></code> =
511    "<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
512<dd>An optional filter for all zip names that are encountered.</dd>
513
514</dl>
515
516<h2><a name="keepmodifier">Keep Modifier Attributes</a></h2>
517
518The keep tags can have the following <i>modifier</i> attributes:
519
520<dl>
521
522<dt><a href="usage.html#allowshrinking"><code><b>allowshrinking</b></code></a>
523    = "<i>boolean</i>"
524    (default = false)</dt>
525<dd>Specifies whether the entry points specified in the keep tag may be
526    shrunk.</dd>
527
528<dt><a href="usage.html#allowoptimization"><code><b>allowoptimization</b></code></a>
529    = "<i>boolean</i>"
530    (default = false)</dt>
531<dd>Specifies whether the entry points specified in the keep tag may be
532    optimized.</dd>
533
534<dt><a href="usage.html#allowobfuscation"><code><b>allowobfuscation</b></code></a>
535    = "<i>boolean</i>"
536    (default = false)</dt>
537<dd>Specifies whether the entry points specified in the keep tag may be
538    obfuscated.</dd>
539
540</dl>
541
542<h2><a name="classspecification">Class Specification Attributes and Nested Elements</a></h2>
543
544The keep tags can have the following <i>class_specification</i> attributes and
545<i>class_member_specifications</i> nested elements:
546
547<dl>
548
549<dt><code><b>access</b></code> = "<i>access_modifiers</i>"</dt>
550<dd>The optional access modifiers of the class. Any space-separated list of
551    "public", "final", and "abstract", with optional negators "!".</dd>
552
553<dt><code><b>annotation</b></code> = "<i>annotation_name</i>"</dt>
554<dd>The optional fully qualified name of an annotation of the class, with
555    optional wildcards.</dd>
556
557<dt><code><b>type</b></code> = "<i>type</i>"</dt>
558<dd>The optional type of the class: one of "class", "interface", or
559    "!interface".</dd>
560
561<dt><code><b>name</b></code> = "<i>class_name</i>"</dt>
562<dd>The optional fully qualified name of the class, with optional
563    wildcards.</dd>
564
565<dt><code><b>extendsannotation</b></code> = "<i>annotation_name</i>"</dt>
566<dd>The optional fully qualified name of an annotation of the the class that
567    the specified classes must extend, with optional wildcards.</dd>
568
569<dt><code><b>extends</b></code> = "<i>class_name</i>"</dt>
570<dd>The optional fully qualified name of the class the specified classes
571    must extend, with optional wildcards.</dd>
572
573<dt><code><b>implements</b></code> = "<i>class_name</i>"</dt>
574<dd>The optional fully qualified name of the class the specified classes
575    must implement, with optional wildcards.</dd>
576
577<dt><code><b>&lt;field</b></code>
578    <a href="#classmemberspecification"><i>class_member_specification</i></a>
579    <code><b>/&gt;</b></code></dt>
580<dd>Specifies a field.</dd>
581
582<dt><code><b>&lt;method</b></code>
583    <a href="#classmemberspecification"><i>class_member_specification</i></a>
584    <code><b>/&gt;</b></code></dt>
585<dd>Specifies a method.</dd>
586
587<dt><code><b>&lt;constructor</b></code>
588    <a href="#classmemberspecification"><i>class_member_specification</i></a>
589    <code><b>/&gt;</b></code></dt>
590<dd>Specifies a constructor.</dd>
591
592</dl>
593
594<h2><a name="classmemberspecification">Class Member Specification Attributes</a></h2>
595
596The class member tags can have the following <i>class_member_specification</i>
597attributes:
598
599<dl>
600
601<dt><code><b>access</b></code> = "<i>access_modifiers</i>"</dt>
602<dd>The optional access modifiers of the class. Any space-separated list of
603    "public", "protected", "private", "static", etc., with optional negators
604    "!".</dd>
605
606<dt><code><b>annotation</b></code> = "<i>annotation_name</i>"</dt>
607<dd>The optional fully qualified name of an annotation of the class member,
608    with optional wildcards.</dd>
609
610<dt><code><b>type</b></code> = "<i>type</i>"</dt>
611<dd>The optional fully qualified type of the class member, with optional
612    wildcards. Not applicable for constructors, but required for methods for
613    which the <code>parameters</code> attribute is specified.</dd>
614
615<dt><code><b>name</b></code> = "<i>name</i>"</dt>
616<dd>The optional name of the class member, with optional wildcards. Not
617    applicable for constructors.</dd>
618
619<dt><code><b>parameters</b></code> = "<i>parameters</i>"</dt>
620<dd>The optional comma-separated list of fully qualified method parameters,
621    with optional wildcards. Not applicable for fields, but required for
622    constructors, and for methods for which the <code>type</code> attribute is
623    specified.</dd>
624
625</dl>
626
627<hr />
628<noscript><div><a target="_top" href="/index.html" class="button">Show menu</a></div></noscript>
629<address>
630Copyright &copy; 2002-2011
631<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
632</address>
633</body>
634</html>
635