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>Gradle Task</title> 8 </head> 9 <body> 10 11 <script type="text/javascript" language="JavaScript"> 12 <!-- 13 if (window.self==window.top) 14 document.write('<a class="largebutton" target="_top" href="../index.html#manual/gradle.html">ProGuard index</a> <a class="largebutton" target="_top" href="http://www.saikoa.com/dexguard">DexGuard</a> <a class="largebutton" target="_top" href="http://www.saikoa.com/">Saikoa</a> <a class="largebutton" target="other" href="http://sourceforge.net/projects/proguard/">Sourceforge</a>') 15 //--> 16 </script> 17 <noscript> 18 <a class="largebutton" target="_top" href="../index.html#manual/gradle.html">ProGuard index</a> 19 <a class="largebutton" target="_top" href="http://www.saikoa.com/dexguard">DexGuard</a> 20 <a class="largebutton" target="_top" href="http://www.saikoa.com/">Saikoa</a> 21 <a class="largebutton" target="other" href="http://sourceforge.net/projects/proguard/">Sourceforge</a> 22 </noscript> 23 24 <h2>Gradle Task</h2> 25 26 <b>ProGuard</b> can be run as a task in the Java-based build tool Gradle 27 (version 2.1 or higher). 28 <p> 29 30 Before you can use the <code>proguard</code> task, you have to make sure 31 Gradle can find it in its class path at build time. One way is to add the 32 following line to your <code>build.gradle</code> file: 33 <p> 34 35 <pre> 36 buildscript { 37 repositories { 38 flatDir dirs: '/usr/local/java/proguard/lib' 39 } 40 dependencies { 41 classpath ':proguard:' 42 } 43 } 44 </pre> 45 <p> 46 47 Please make sure the class path is set correctly for your system. 48 <p> 49 50 You can then define a task: 51 <p> 52 <pre> 53 task myProguardTask(type: proguard.gradle.ProGuardTask) { 54 ..... 55 } 56 </pre> 57 <p> 58 59 The embedded configuration is much like a standard ProGuard configuration. 60 Notable similarities and differences: 61 <ul> 62 <li>Like in ProGuard-style configurations, we're using all lower-case names 63 for the settings.</li> 64 <li>The options don't have a dash as prefix.</li> 65 <li>Arguments typically have quotes.</li> 66 <li>Some settings are specified as named arguments.</li> 67 </ul> 68 <p> 69 You can find some sample build files in the <code>examples/gradle</code> 70 directory of the ProGuard distribution. 71 <p> 72 If you prefer a more verbose configuration derived from the Ant task, you can 73 import the Ant task as a <a href="#anttask">Gradle task</a>. 74 75 <h2><a name="proguard">Settings</a></h2> 76 77 The ProGuard task supports the following settings in its closure: 78 79 <dl> 80 81 <dt><a name="configuration_attribute"><code><b>configuration</b></code></a> 82 <a href="#file"><i>files</i></a></dt> 83 <dd>Read and merge options from the given ProGuard-style configuration 84 files. The files are resolved and parsed lazily, during the execution 85 phase.</dd> 86 87 <dt><a href="usage.html#injars"><code><b>injars</b></code></a> 88 <a href="#classpath"><i>class_path</i></a></dt> 89 <dd>Specifies the program jars (or aars, wars, ears, zips, apks, or 90 directories). The files are resolved and read lazily, during the execution 91 phase.</dd> 92 93 <dt><a href="usage.html#outjars"><code><b>outjars</b></code></a> 94 <a href="#classpath"><i>class_path</i></a></dt> 95 <dd>Specifies the names of the output jars (or aars, wars, ears, zips, apks, or 96 directories). The files are resolved and written lazily, during the 97 execution phase.</dd> 98 99 <dt><a href="usage.html#libraryjars"><code><b>libraryjars</b></code></a> 100 <a href="#classpath"><i>class_path</i></a></dt> 101 <dd>Specifies the library jars (or aars, wars, ears, zips, apks, or 102 directories). The files are resolved and read lazily, during the execution 103 phase.</dd> 104 105 <dt><a href="usage.html#skipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a></dt> 106 <dd>Ignore non-public library classes.</dd> 107 108 <dt><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>dontskipnonpubliclibraryclassmembers</b></code></a></dt> 109 <dd>Don't ignore package visible library class members.</dd> 110 111 <dt><a href="usage.html#keepdirectories"><code><b>keepdirectories</b></code></a> 112 ['<a href="usage.html#filefilters"><i>directory_filter</i></a>']</dt> 113 <dd>Keep the specified directories in the output jars (or aars, wars, ears, 114 zips, apks, or directories).</dd> 115 116 <dt><a href="usage.html#target"><code><b>target</b></code></a> 117 '<i>version</i>'</dt> 118 <dd>Set the given version number in the processed classes.</dd> 119 120 <dt><a href="usage.html#forceprocessing"><code><b>forceprocessing</b></code></a></dt> 121 <dd>Process the input, even if the output seems up to date.</dd> 122 123 <dt><a href="usage.html#keep"><code><b>keep</b></code></a> 124 [<a href="#keepmodifier"><i>modifier</i>,...</a>] 125 <a href="#classspecification"><i>class_specification</i></a></dt> 126 <dd>Preserve the specified classes <i>and</i> class members.</dd> 127 128 <dt><a href="usage.html#keepclassmembers"><code><b>keepclassmembers</b></code></a> 129 [<a href="#keepmodifier"><i>modifier</i>,...</a>] 130 <a href="#classspecification"><i>class_specification</i></a></dt> 131 <dd>Preserve the specified class members, if their classes are preserved as 132 well.</dd> 133 134 <dt><a href="usage.html#keepclasseswithmembers"><code><b>keepclasseswithmembers</b></code></a> 135 [<a href="#keepmodifier"><i>modifier</i>,...</a>] 136 <a href="#classspecification"><i>class_specification</i></a></dt> 137 <dd>Preserve the specified classes <i>and</i> class members, if all of the 138 specified class members are present.</dd> 139 140 <dt><a href="usage.html#keepnames"><code><b>keepnames</b></code></a> 141 <a href="#classspecification"><i>class_specification</i></a></dt> 142 <dd>Preserve the names of the specified classes <i>and</i> class members (if 143 they aren't removed in the shrinking step).</dd> 144 145 <dt><a href="usage.html#keepclassmembernames"><code><b>keepclassmembernames</b></code></a> 146 <a href="#classspecification"><i>class_specification</i></a></dt> 147 <dd>Preserve the names of the specified class members (if they aren't removed 148 in the shrinking step).</dd> 149 150 <dt><a href="usage.html#keepclasseswithmembernames"><code><b>keepclasseswithmembernames</b></code></a> 151 <a href="#classspecification"><i>class_specification</i></a></dt> 152 <dd>Preserve the names of the specified classes <i>and</i> class members, if 153 all of the specified class members are present (after the shrinking 154 step).</dd> 155 156 <dt><a href="usage.html#printseeds"><code><b>printseeds</b></code></a> 157 [<a href="#file"><i>file</i></a>]</dt> 158 <dd>List classes and class members matched by the various <code>keep</code> 159 commands, to the standard output or to the given file.</dd> 160 161 <dt><a href="usage.html#dontshrink"><code><b>dontshrink</b></code></a></dt> 162 <dd>Don't shrink the input class files.</dd> 163 164 <dt><a href="usage.html#printusage"><code><b>printusage</b></code></a> 165 [<a href="#file"><i>file</i></a>]</dt> 166 <dd>List dead code of the input class files, to the standard output or to the 167 given file.</dd> 168 169 <dt><a href="usage.html#whyareyoukeeping"><code><b>whyareyoukeeping</b></code></a> 170 <a href="#classspecification"><i>class_specification</i></a></dt> 171 <dd>Print details on why the given classes and class members are being kept in 172 the shrinking step.</dd> 173 174 <dt><a href="usage.html#dontoptimize"><code><b>dontoptimize</b></code></a></dt> 175 <dd>Don't optimize the input class files.</dd> 176 177 <dt><a href="usage.html#optimizations"><code><b>optimizations</b></code></a> '<a href="optimizations.html"><i>optimization_filter</i></a>'</dt> 178 <dd>Perform only the specified optimizations.</dd> 179 180 <dt><a href="usage.html#optimizationpasses"><code><b>optimizationpasses</b></code></a> 181 <i>n</i></dt> 182 <dd>The number of optimization passes to be performed.</dd> 183 184 <dt><a href="usage.html#assumenosideeffects"><code><b>assumenosideeffects</b></code></a> 185 <a href="#classspecification"><i>class_specification</i></a></dt> 186 <dd>Assume that the specified methods don't have any side effects, while 187 optimizing. <i>Only use this option if you know what you're 188 doing!</i></dd> 189 190 <dt><a href="usage.html#allowaccessmodification"><code><b>allowaccessmodification</b></code></a></dt> 191 <dd>Allow the access modifiers of classes and class members to be modified, 192 while optimizing.</dd> 193 194 <dt><a href="usage.html#mergeinterfacesaggressively"><code><b>mergeinterfacesaggressively</b></code></a></dt> 195 <dd>Allow any interfaces to be merged, while optimizing.</dd> 196 197 <dt><a href="usage.html#dontobfuscate"><code><b>dontobfuscate</b></code></a></dt> 198 <dd>Don't obfuscate the input class files.</dd> 199 200 <dt><a href="usage.html#printmapping"><code><b>printmapping</b></code></a> 201 [<a href="#file"><i>file</i></a>]</dt> 202 <dd>Print the mapping from old names to new names for classes and class members 203 that have been renamed, to the standard output or to the given file.</dd> 204 205 <dt><a href="usage.html#applymapping"><code><b>applymapping</b></code></a> 206 <a href="#file"><i>file</i></a></dt> 207 <dd>Reuse the given mapping, for incremental obfuscation.</dd> 208 209 <dt><a href="usage.html#obfuscationdictionary"><code><b>obfuscationdictionary</b></code></a> 210 <a href="#file"><i>file</i></a></dt> 211 <dd>Use the words in the given text file as obfuscated field names and method 212 names.</dd> 213 214 <dt><a href="usage.html#classobfuscationdictionary"><code><b>classobfuscationdictionary</b></code></a> 215 <a href="#file"><i>file</i></a></dt> 216 <dd>Use the words in the given text file as obfuscated class names.</dd> 217 218 <dt><a href="usage.html#packageobfuscationdictionary"><code><b>packageobfuscationdictionary</b></code></a> 219 <a href="#file"><i>file</i></a></dt> 220 <dd>Use the words in the given text file as obfuscated package names.</dd> 221 222 <dt><a href="usage.html#overloadaggressively"><code><b>overloadaggressively</b></code></a></dt> 223 <dd>Apply aggressive overloading while obfuscating.</dd> 224 225 <dt><a href="usage.html#useuniqueclassmembernames"><code><b>useuniqueclassmembernames</b></code></a></dt> 226 <dd>Ensure uniform obfuscated class member names for subsequent incremental 227 obfuscation.</dd> 228 229 <dt><a href="usage.html#dontusemixedcaseclassnames"><code><b>dontusemixedcaseclassnames</b></code></a></dt> 230 <dd>Don't generate mixed-case class names while obfuscating.</dd> 231 232 <dt><a href="usage.html#keeppackagenames"><code><b>keeppackagenames</b></code></a> ['<a href="usage.html#filters"><i>package_filter</i></a>']</dt> 233 <dd>Keep the specified package names from being obfuscated. If no name is 234 given, all package names are preserved.</dd> 235 236 <dt><a href="usage.html#flattenpackagehierarchy"><code><b>flattenpackagehierarchy</b></code></a> 237 '<i>package_name</i>'</dt> 238 <dd>Repackage all packages that are renamed into the single given parent 239 package.</dd> 240 241 <dt><a href="usage.html#repackageclasses"><code><b>repackageclasses</b></code></a> 242 ['<i>package_name</i>']</dt> 243 <dd>Repackage all class files that are renamed into the single given 244 package.</dd> 245 246 <dt><a href="usage.html#keepattributes"><code><b>keepattributes</b></code></a> ['<a href="usage.html#filters"><i>attribute_filter</i></a>']</dt> 247 <dd>Preserve the specified optional Java bytecode attributes, with optional 248 wildcards. If no name is given, all attributes are preserved.</dd> 249 250 <dt><a href="usage.html#keepparameternames"><code><b>keepparameternames</b></code></a></dt> 251 <dd>Keep the parameter names and types of methods that are kept.</dd> 252 253 <dt><a href="usage.html#renamesourcefileattribute"><code><b>renamesourcefileattribute</b></code></a> 254 ['<i>string</i>']</dt> 255 <dd>Put the given constant string in the <code>SourceFile</code> 256 attributes.</dd> 257 258 <dt><a href="usage.html#adaptclassstrings"><code><b>adaptclassstrings</b></code></a> 259 ['<a href="usage.html#filters"><i>class_filter</i></a>']</dt> 260 <dd>Adapt string constants in the specified classes, based on the obfuscated 261 names of any corresponding classes.</dd> 262 263 <dt><a href="usage.html#adaptresourcefilenames"><code><b>adaptresourcefilenames</b></code></a> 264 ['<a href="usage.html#filefilters"><i>file_filter</i></a>']</dt> 265 <dd>Rename the specified resource files, based on the obfuscated names of the 266 corresponding class files.</dd> 267 268 <dt><a href="usage.html#adaptresourcefilecontents"><code><b>adaptresourcefilecontents</b></code></a> 269 ['<a href="usage.html#filefilters"><i>file_filter</i></a>']</dt> 270 <dd>Update the contents of the specified resource files, based on the 271 obfuscated names of the processed classes.</dd> 272 273 <dt><a href="usage.html#dontpreverify"><code><b>dontpreverify</b></code></a></dt> 274 <dd>Don't preverify the processed class files if they are targeted at Java Micro 275 Edition or at Java 6 or higher.</dd> 276 277 <dt><a href="usage.html#microedition"><code><b>microedition</b></code></a></dt> 278 <dd>Target the processed class files at Java Micro Edition.</dd> 279 280 <dt><a href="usage.html#verbose"><code><b>verbose</b></code></a></dt> 281 <dd>Write out some more information during processing.</dd> 282 283 <dt><a href="usage.html#dontnote"><code><b>dontnote</b></code></a> '<a href="usage.html#filters"><i>class_filter</i></a>'</dt> 284 <dd>Don't print notes about classes matching the specified class name 285 filter.</dd> 286 287 <dt><a href="usage.html#dontwarn"><code><b>dontwarn</b></code></a> '<a href="usage.html#filters"><i>class_filter</i></a>'</dt> 288 <dd>Don't print warnings about classes matching the specified class name 289 filter. <i>Only use this option if you know what you're doing!</i></dd> 290 291 <dt><a href="usage.html#ignorewarnings"><code><b>ignorewarnings</b></code></a></dt> 292 <dd>Print warnings about unresolved references, but continue processing 293 anyhow. <i>Only use this option if you know what you're doing!</i></dd> 294 295 <dt><a href="usage.html#printconfiguration"><code><b>printconfiguration</b></code></a> 296 [<a href="#file"><i>file</i></a>]</dt> 297 <dd>Write out the entire configuration in traditional ProGuard style, to the 298 standard output or to the given file. Useful to replace unreadable 299 XML configurations.</dd> 300 301 <dt><a href="usage.html#dump"><code><b>dump</b></code></a> 302 [<a href="#file"><i>file</i></a>]</dt> 303 <dd>Write out the internal structure of the processed class files, to the 304 standard output or to the given file.</dd> 305 306 </dl> 307 308 <h2><a name="classpath">Class Paths</a></h2> 309 310 Class paths are specified as Gradle file collections, which means they can be 311 specified as simple strings, with <code>files(Object)</code>, etc. 312 <p> 313 In addition, they can have ProGuard-style filters, specified as 314 comma-separated named arguments after the file: 315 316 <dl> 317 318 <dt><code><b>filter:</b></code> 319 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 320 <dd>An optional filter for all class file names and resource file names that 321 are encountered.</dd> 322 323 <dt><code><b>apkfilter:</b></code> 324 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 325 <dd>An optional filter for all apk names that are encountered.</dd> 326 327 <dt><code><b>jarfilter:</b></code> 328 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 329 <dd>An optional filter for all jar names that are encountered.</dd> 330 331 <dt><code><b>aarfilter:</b></code> 332 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 333 <dd>An optional filter for all aar names that are encountered.</dd> 334 335 <dt><code><b>warfilter:</b></code> 336 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 337 <dd>An optional filter for all war names that are encountered.</dd> 338 339 <dt><code><b>earfilter:</b></code> 340 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 341 <dd>An optional filter for all ear names that are encountered.</dd> 342 343 <dt><code><b>zipfilter:</b></code> 344 '<a href="usage.html#filefilters"><i>file_filter</i></a>'</dt> 345 <dd>An optional filter for all zip names that are encountered.</dd> 346 347 </dl> 348 349 <h2><a name="file">Files</a></h2> 350 351 Files are specified as Gradle files, which means they can be specified 352 as simple strings, as File instances, with <code>file(Object)</code>, etc. 353 <p> 354 In Gradle, file names (any strings really) in double quotes can contain 355 properties or code inside <code>${...}</code>. These are automatically 356 expanded. 357 <p> 358 For example, <code>"${System.getProperty('java.home')}/lib/rt.jar"</code> is 359 expanded to something like <code>'/usr/local/java/jdk/jre/lib/rt.jar'</code>. 360 Similarly, <code>System.getProperty('user.home')</code> is expanded to the 361 user's home directory, and <code>System.getProperty('user.dir')</code> is 362 expanded to the current working directory. 363 364 <h2><a name="keepmodifier">Keep Modifiers</a></h2> 365 366 The keep settings can have the following named arguments that modify their 367 behaviors: 368 369 <dl> 370 371 <dt><a href="usage.html#includedescriptorclasses"><code><b>includedescriptorclasses:</b></code></a> 372 <i>boolean</i> 373 (default = false)</dt> 374 <dd>Specifies whether the classes of the fields and methods specified in the 375 keep tag must be kept as well.</dd> 376 377 <dt><a href="usage.html#allowshrinking"><code><b>allowshrinking:</b></code></a> 378 <i>boolean</i> 379 (default = false)</dt> 380 <dd>Specifies whether the entry points specified in the keep tag may be 381 shrunk.</dd> 382 383 <dt><a href="usage.html#allowoptimization"><code><b>allowoptimization:</b></code></a> 384 <i>boolean</i> 385 (default = false)</dt> 386 <dd>Specifies whether the entry points specified in the keep tag may be 387 optimized.</dd> 388 389 <dt><a href="usage.html#allowobfuscation"><code><b>allowobfuscation:</b></code></a> 390 <i>boolean</i> 391 (default = false)</dt> 392 <dd>Specifies whether the entry points specified in the keep tag may be 393 obfuscated.</dd> 394 395 </dl> 396 397 Names arguments are comma-separated, as usual. 398 399 <h2><a name="classspecification">Class Specifications</a></h2> 400 401 A class specification is a template of classes and class members (fields and methods). There are two alternative ways to specify such a template: 402 403 <ol> 404 <li>As a string containing a ProGuard-style class specification. This is the 405 most compact and most readable way. The specification looks like a Java 406 declaration of a class with fields and methods. For example: 407 <pre> 408 keep 'public class mypackage.MyMainClass { \ 409 public static void main(java.lang.String[]); \ 410 }' 411 </pre></li> 412 <li>As a Gradle-style setting: a method calls with named arguments and a 413 closure. This is more verbose, but it might be useful for programmatic 414 specifications. For example: 415 <pre> 416 keep access: 'public', 417 name: 'mypackage.MyMainClass', { 418 method access: 'public static', 419 type: 'void', 420 name: 'main', 421 parameters: 'java.lang.String[]' 422 } 423 </pre></li> 424 </ol> 425 <p> 426 427 The <a href="usage.html#classspecification">ProGuard-style class 428 specification</a> is described on the traditional Usage page. 429 <p> 430 A Gradle-style class specification can have the following named arguments: 431 432 <dl> 433 434 <dt><code><b>access:</b></code> '<i>access_modifiers</i>'</dt> 435 <dd>The optional access modifiers of the class. Any space-separated list of 436 "public", "final", and "abstract", with optional negators "!".</dd> 437 438 <dt><code><b>annotation:</b></code> '<i>annotation_name</i>'</dt> 439 <dd>The optional fully qualified name of an annotation of the class, with 440 optional wildcards.</dd> 441 442 <dt><code><b>type:</b></code> '<i>type</i>'</dt> 443 <dd>The optional type of the class: one of "class", "interface", or 444 "!interface".</dd> 445 446 <dt><code><b>name:</b></code> '<i>class_name</i>'</dt> 447 <dd>The optional fully qualified name of the class, with optional 448 wildcards.</dd> 449 450 <dt><code><b>extendsannotation:</b></code> '<i>annotation_name</i>'</dt> 451 <dd>The optional fully qualified name of an annotation of the the class that 452 the specified classes must extend, with optional wildcards.</dd> 453 454 <dt><code><b>'extends':</b></code> '<i>class_name</i>'</dt> 455 <dd>The optional fully qualified name of the class the specified classes 456 must extend, with optional wildcards.</dd> 457 458 <dt><code><b>'implements':</b></code> '<i>class_name</i>'</dt> 459 <dd>The optional fully qualified name of the class the specified classes 460 must implement, with optional wildcards.</dd> 461 462 </dl> 463 464 The named arguments are optional. Without any arguments, there are no 465 constraints, so the settings match all classes. 466 <p> 467 468 <h3><a name="classmemberspecification">Gradle-style Class Member Specifications</a></h3> 469 470 The closure of a Gradle-style class specification can specify class members 471 with these settings: 472 473 <dl> 474 475 <dt><code><b>field</b></code> <i>field_constraints</i></dt> 476 <dd>Specifies a field.</dd> 477 478 <dt><code><b>method</b></code> <i>method_constraints</i></dt> 479 <dd>Specifies a method.</dd> 480 481 <dt><code><b>constructor</b></code> <i>constructor_constraints</i></dt> 482 <dd>Specifies a constructor.</dd> 483 484 </dl> 485 486 A class member setting can have the following named arguments to express 487 constraints: 488 489 <dl> 490 491 <dt><code><b>access:</b></code> '<i>access_modifiers</i>'</dt> 492 <dd>The optional access modifiers of the class. Any space-separated list of 493 "public", "protected", "private", "static", etc., with optional negators 494 "!".</dd> 495 496 <dt><code><b>'annotation':</b></code> '<i>annotation_name</i>'</dt> 497 <dd>The optional fully qualified name of an annotation of the class member, 498 with optional wildcards.</dd> 499 500 <dt><code><b>type:</b></code> '<i>type</i>'</dt> 501 <dd>The optional fully qualified type of the class member, with optional 502 wildcards. Not applicable for constructors, but required for methods for 503 which the <code>parameters</code> argument is specified.</dd> 504 505 <dt><code><b>name:</b></code> '<i>name</i>'</dt> 506 <dd>The optional name of the class member, with optional wildcards. Not 507 applicable for constructors.</dd> 508 509 <dt><code><b>parameters:</b></code> '<i>parameters</i>'</dt> 510 <dd>The optional comma-separated list of fully qualified method parameters, 511 with optional wildcards. Not applicable for fields, but required for 512 constructors, and for methods for which the <code>type</code> argument is 513 specified.</dd> 514 515 </dl> 516 517 The named arguments are optional. Without any arguments, there are no 518 constraints, so the settings match all constructors, fields, or methods. 519 <p> 520 A class member setting doesn't have a closure. 521 522 <h2><a name="anttask">Alternative: imported Ant task</a></h2> 523 524 Instead of using the Gradle task, you could also integrate the Ant task in 525 your Gradle build file: 526 <p> 527 <pre> 528 ant.project.basedir = '../..' 529 530 ant.taskdef(resource: 'proguard/ant/task.properties', 531 classpath: '/usr/local/java/proguard/lib/proguard.jar') 532 </pre> 533 <p> 534 535 Gradle automatically converts the elements and attributes to Groovy methods, 536 so converting the configuration is essentially mechanical. The one-on-one 537 mapping can be useful, but the resulting configuration is more verbose. For 538 instance: 539 <pre> 540 task proguard << { 541 ant.proguard(printmapping: 'proguard.map', 542 overloadaggressively: 'on', 543 repackageclasses: '', 544 renamesourcefileattribute: 'SourceFile') { 545 546 injar(file: 'application.jar') 547 injar(file: 'gui.jar', filter: '!META-INF/**') 548 549 ..... 550 } 551 } 552 </pre> 553 <p> 554 555 <hr /> 556 <address> 557 Copyright © 2002-2014 558 <a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a> @ <a target="top" href="http://www.saikoa.com/">Saikoa</a>. 559 </address> 560 </body> 561 </html> 562