Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 1 | page.title=Android Plugin for Gradle Release Notes |
| 2 | |
| 3 | @jd:body |
| 4 | |
| 5 | <div id="qv-wrapper"> |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 6 | <div id="qv"> |
| 7 | <h2> |
| 8 | In this document |
| 9 | </h2> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 10 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 11 | <ol> |
| 12 | <li> |
| 13 | <a href="#updating-plugin">Updating the Android Plugin for Gradle |
| 14 | Version</a> |
| 15 | </li> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 16 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 17 | <li> |
| 18 | <a href="#updating-gradle">Updating the Gradle Version</a> |
| 19 | </li> |
| 20 | |
| 21 | <li> |
| 22 | <a href="#revisions">Revisions</a> |
| 23 | </li> |
| 24 | </ol> |
| 25 | |
| 26 | <h2> |
| 27 | See also |
| 28 | </h2> |
| 29 | |
| 30 | <ol> |
| 31 | <li> |
| 32 | <a href="{@docRoot}sdk/installing/studio-build.html">Build System |
| 33 | Overview</a> |
| 34 | </li> |
| 35 | |
| 36 | <li> |
| 37 | <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android |
| 38 | Plugin for Gradle</a> |
| 39 | </li> |
| 40 | </ol> |
| 41 | </div> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 42 | </div> |
| 43 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 44 | <p> |
| 45 | The Android build system uses the Android Plugin for Gradle to support |
| 46 | building Android applications with the <a href= |
| 47 | "http://www.gradle.org/">Gradle</a> build toolkit. The plugin runs |
| 48 | independent of Android Studio so the plugin and the Gradle build system can |
| 49 | be updated independently of Android Studio. |
| 50 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 51 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 52 | <h2 id="updating-plugin"> |
| 53 | Updating the Android Plugin for Gradle |
| 54 | </h2> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 55 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 56 | <p> |
| 57 | When you update Android Studio, you may receive a prompt to automatically |
| 58 | update the Android Plugin for Gradle to the latest available version. You |
| 59 | can choose to accept the update or manually specify a version based on |
| 60 | your project's build requirements. |
| 61 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 62 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 63 | <p> |
| 64 | You can specify the <a href= |
| 65 | "{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin for |
| 66 | Gradle</a> version in either the <strong>File</strong> > <strong>Project |
| 67 | Structure</strong> > <strong>Project</strong> menu in Android Studio, or |
| 68 | the top-level <code>build.gradle</code> file. The plugin version applies to |
| 69 | all modules built in that Android Studio project. The following example sets |
| 70 | the Android Plugin for Gradle to version 2.0.0 from the |
| 71 | <code>build.gradle</code> file: |
| 72 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 73 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 74 | <pre> |
| 75 | buildscript { |
| 76 | ... |
| 77 | dependencies { |
| 78 | classpath 'com.android.tools.build:gradle:2.0.0' |
| 79 | } |
| 80 | } |
| 81 | </pre> |
| 82 | <p class="caution"> |
| 83 | <strong>Caution:</strong> You should not use dynamic dependencies in version |
| 84 | numbers, such as <code>'com.android.tools.build:gradle:2.+'</code>. Using |
| 85 | this feature can cause unexpected version updates and difficulty resolving |
| 86 | version differences. |
| 87 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 88 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 89 | <p> |
| 90 | If the specified plugin version has not been downloaded, Gradle downloads it |
| 91 | the next time you build your project or click <strong>Tools</strong> > |
| 92 | <strong>Android</strong> > <strong>Sync Project with Gradle Files</strong> |
| 93 | from the Android Studio main menu. |
| 94 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 95 | |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 96 | <h2 id="updating-gradle"> |
| 97 | Updating Gradle |
| 98 | </h2> |
| 99 | |
| 100 | <p> |
| 101 | When you update Android Studio, you may receive a prompt to automatically |
| 102 | update Gradle to the latest available version. You can choose to accept the |
| 103 | update or manually specify a version based on your project's build |
| 104 | requirements. |
| 105 | </p> |
| 106 | |
| 107 | <p> |
| 108 | You can specify the Gradle version in either the <strong>File</strong> > |
| 109 | <strong>Project Structure</strong> > <strong>Project</strong> menu in |
| 110 | Android Studio, or by editing the Gradle distribution reference in the |
| 111 | <code>gradle/wrapper/gradle-wrapper.properties</code> file. The following |
| 112 | example sets the Gradle version to 2.10 in the |
| 113 | <code>gradle-wrapper.properties</code> file. |
| 114 | </p> |
| 115 | |
| 116 | <pre> |
| 117 | ... |
| 118 | distributionUrl = https\://services.gradle.org/distributions/gradle-2.10-all.zip |
| 119 | ... |
| 120 | </pre> |
| 121 | |
| 122 | <h2 id="revisions"> |
| 123 | Revisions |
| 124 | </h2> |
| 125 | |
| 126 | <p> |
| 127 | For a summary of known issues in Android Plugin for Gradle, visit the |
| 128 | <a class="external-link" href="http://tools.android.com/knownissues">Android |
| 129 | Tools Project Site</a>. |
| 130 | </p> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 131 | |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 132 | <div class="toggle-content opened"> |
| 133 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 134 | <img src="{@docRoot}assets/images/styles/disclosure_up.png" class="toggle-content-img" |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 135 | alt=""/>Android Plugin for Gradle, Revision 2.0.0</a> <em>(March 2016)</em> |
| 136 | </p> |
| 137 | |
| 138 | <div class="toggle-content-toggleme"> |
| 139 | <dl> |
| 140 | <dt>Dependencies:</dt> |
| 141 | |
| 142 | <dd> |
| 143 | <ul> |
| 144 | <li>Gradle 2.10 or higher. |
| 145 | </li> |
| 146 | |
| 147 | <li> |
| 148 | <a href="{@docRoot}tools/revisions/build-tools.html">Build Tools 21.1.1</a> |
| 149 | or higher. |
| 150 | </li> |
| 151 | </ul> |
| 152 | </dd> |
| 153 | |
| 154 | <dt>New:</dt> |
| 155 | <dd> |
| 156 | <ul> |
| 157 | <li>Enables <a href= |
| 158 | "{@docRoot}tools/building/building-studio.html#instant-run">Instant Run</a> by |
| 159 | supporting bytecode injection, and pushing code and resource updates to a |
| 160 | running app on the emulator or a physical device. |
| 161 | </li> |
| 162 | |
| 163 | <li>Added support for incremental builds, even when the app isn’t running. |
| 164 | Full build times are improved by pushing incremental changes through the |
| 165 | <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> to the |
| 166 | connected device. |
| 167 | </li> |
| 168 | |
| 169 | <li>Added <code>maxProcessCount</code> to control how many slave dex processes can |
| 170 | be spawned concurrently. The following code, in the module-level |
| 171 | <code>build.gradle</code> file, sets the maximum number of concurrent processes |
| 172 | to 4: |
| 173 | <pre> |
| 174 | android { |
| 175 | ... |
| 176 | dexOptions { |
| 177 | maxProcessCount = 4 |
| 178 | } |
| 179 | } |
| 180 | </pre> |
| 181 | </li> |
| 182 | |
| 183 | <li>Added an experimental code shrinker to support pre-dexing and reduce re-dexing |
| 184 | of dependencies, which are not supported with Proguard. This improves the build |
| 185 | speed of your debug build variant. Because the experimental shrinker does not |
| 186 | support optimization and obfuscation, you should enable Proguard for your |
| 187 | release builds. To enable the experimental shrinker for your debug builds, add |
| 188 | the following to your module-level <code>build.gradle</code> file: |
| 189 | |
| 190 | <pre> |
| 191 | android { |
| 192 | ... |
| 193 | buildTypes { |
| 194 | debug { |
| 195 | minifyEnabed true |
| 196 | useProguard false |
| 197 | } |
| 198 | release { |
| 199 | minifyEnabed true |
| 200 | useProguard true // this is a default setting |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | </pre> |
| 205 | </li> |
| 206 | |
| 207 | <li>Added logging support and improved performance for the resource shrinker. |
| 208 | The resource shrinker now logs all of its operations into a <code>resources.txt</code> |
| 209 | file located in the same folder as the Proguard log files. |
| 210 | </li> |
| 211 | </ul> |
| 212 | </dd> |
| 213 | |
| 214 | <dt>Changed behavior:</dt> |
| 215 | <dd> |
| 216 | <ul> |
| 217 | <li>When <code>minSdkVersion</code> is set to 18 or higher, APK signing uses |
| 218 | SHA256. |
| 219 | </li> |
| 220 | |
| 221 | <li>DSA and ECDSA keys can now sign APK packages. |
| 222 | |
| 223 | <p class="note"> |
| 224 | <strong>Note:</strong> The <a href= |
| 225 | "{@docRoot}training/articles/keystore.html">Android keystore</a> provider no |
| 226 | longer supports <a href= |
| 227 | "{@docRoot}about/versions/marshmallow/android-6.0-changes.html#behavior-keystore"> |
| 228 | DSA keys on Android 6.0</a> (API level 23) and higher. |
| 229 | </p> |
| 230 | |
| 231 | </li> |
| 232 | </ul> |
| 233 | </dd> |
| 234 | |
| 235 | <dt>Fixed issues:</dt> |
| 236 | <dd> |
| 237 | <ul> |
| 238 | <li>Fixed an issue that caused duplicate AAR dependencies in both |
| 239 | the test and main build configurations. |
| 240 | </li> |
| 241 | </ul> |
| 242 | </dd> |
| 243 | </div> |
| 244 | </div> |
| 245 | |
| 246 | <div class="toggle-content closed"> |
| 247 | <p><a href="#" onclick="return toggleContent(this)"> |
| 248 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Cheryl Potter | 8ac5c1d | 2015-11-19 15:05:21 -0800 | [diff] [blame] | 249 | alt=""/>Android Plugin for Gradle, Revision 1.5.0</a> <em>(November 2015)</em> |
| 250 | </p> |
| 251 | |
| 252 | <div class="toggle-content-toggleme"> |
| 253 | |
| 254 | <dl> |
| 255 | <dt>Dependencies:</dt> |
| 256 | |
| 257 | <dd> |
| 258 | <ul> |
| 259 | <li>Gradle 2.2.1 or higher.</li> |
| 260 | <li>Build Tools 21.1.1 or higher.</li> |
| 261 | </ul> |
| 262 | </dd> |
| 263 | |
| 264 | <dt>General Notes:</dt> |
| 265 | <dd> |
| 266 | <ul> |
| 267 | <li>Integrated the Data Binding Plugin into the Android Plugin for Gradle. To enable it, add |
| 268 | the following code to each per-project <code>build.gradle</code> file that uses the |
| 269 | plugin:</li> |
| 270 | <pre> |
| 271 | android { |
| 272 | dataBinding { |
| 273 | enabled = true |
| 274 | } |
| 275 | } |
| 276 | </pre> |
| 277 | <li>Added a new <a href="http://google.github.io/android-gradle-dsl/javadoc/1.5/" class="external-link">Transform API</a> |
| 278 | to allow third-party plugins to manipulate compiled <code>.class</code> files before they’re |
| 279 | converted to <code>.dex</code> files. The Transform API simplifies injecting custom class |
| 280 | manipulations while offering more flexibility regarding what you can manipulate. To insert a |
| 281 | transform into a build, create a new class implementing one of the <code>Transform</code> |
| 282 | interfaces, and register it with <code>android.registerTransform(theTransform)</code> or |
| 283 | <code>android.registerTransform(theTransform, dependencies)</code>. There’s no need to |
| 284 | wire tasks together. Note the following about the Transform API:</li> |
| 285 | <ul> |
| 286 | <li>A transform can apply to one or more of the following: the current project, subprojects, |
| 287 | and external libraries.</li> |
| 288 | <li>A transform must be registered globally, which applies them to all variants.</li> |
| 289 | <li>Internal code processing, through the Java Code Coverage Library (JaCoCo), ProGuard, |
| 290 | and MultiDex, now uses the Transform API. However, the Java Android Compiler Kit |
| 291 | (Jack) doesn’t use this API: only the <code>javac/dx</code> code path does.</li> |
| 292 | <li>Gradle executes the transforms in this order: JaCoCo, third-party plugins, ProGuard. |
| 293 | The execution order for third-party plugins matches the order in which the transforms are |
| 294 | added by the third party plugins; third-party plugin developers can't control the execution |
| 295 | order of the transforms through an API.</li> |
| 296 | </ul> |
| 297 | <li>Deprecated the <code>dex</code> getter from the <code>ApplicationVariant</code> class. |
| 298 | You can't access the <code>Dex</code> task through the variant API anymore because it’s now |
| 299 | accomplished through a transform. There's |
| 300 | currently no replacement for controlling the dex process.</li> |
| 301 | <li>Fixed incremental support for assets.</li> |
| 302 | <li>Improved MultiDex support by making it available for test projects, and |
| 303 | tests now automatically have the <code>com.android.support:multidex-instrumentation</code> |
| 304 | dependency.</li> |
| 305 | <li>Added the ability to properly fail a Gradle build and report the underlying error cause |
| 306 | when the Gradle build invokes asynchronous tasks and there’s a failure in the worker |
| 307 | process.</li> |
| 308 | <li>Added support for configuring a specific Application Binary Interface (ABI) in variants |
| 309 | that contain multiple ABIs.</li> |
| 310 | <li>Added support for a comma-separated list of device serial numbers for the |
| 311 | <code>ANDROID_SERIAL</code> environment variable when installing or running tests.</li> |
| 312 | <li>Fixed an installation failure on devices running Android 5.0 (API level 20) and higher |
| 313 | when the APK name contains a space.</li> |
| 314 | <li>Fixed various issues related to the Android Asset Packaging Tool (AAPT) error output.</li> |
| 315 | <li>Added JaCoCo incremental instrumentation support for faster incremental builds. The |
| 316 | Android Plugin for Gradle now invokes the JaCoCo instrumenter directly. To force a newer |
| 317 | version of the JaCoCo instrumenter, you need to add it as a build script dependency.</li> |
| 318 | <li>Fixed JaCoCo support so it ignores files that aren’t classes.</li> |
| 319 | <li>Added vector drawable support for generating PNGs at build time for backward-compatibility. |
| 320 | Android Plugin for Gradle generates PNGs for every vector drawable found in a resource |
| 321 | directory that doesn’t specify an API version or specifies an |
| 322 | <code>android:minSdkVersion</code> attribute of 20 or lower in the |
| 323 | <code><uses-sdk></code> element in the app manifest. You can set PNG densities by |
| 324 | using the <code>generatedDensities</code> property in the <code>defaultConfig</code> or |
| 325 | <code>productFlavor</code> sections of a <code>build.gradle</code> file.</li> |
| 326 | <li>Added sharing of the mockable <code>android.jar</code>, which the plugin generates only |
| 327 | once and uses for unit testing. Multiple modules, such as <code>app</code> and |
| 328 | <code>lib</code>, now share it. Delete <code>$rootDir/build</code> to regenerate it. </li> |
| 329 | <li>Changed the processing of Java resources to occur before the obfuscation tasks instead of |
| 330 | during the packaging of the APK. This change allows the obfuscation tasks to have a chance |
| 331 | to adapt the Java resources following packages obfuscation.</li> |
| 332 | <li>Fixed an issue with using Java Native Interface (JNI) code in the experimental library |
| 333 | plugin.</li> |
| 334 | <li>Added the ability to set the platform version separately from the |
| 335 | <code>android:compileSdkVersion</code> attribute in the experimental library |
| 336 | plugin.</li> |
| 337 | </ul> |
| 338 | </dd> |
| 339 | </div> |
| 340 | </div> |
| 341 | |
| 342 | <div class="toggle-content closed"> |
| 343 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 344 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | d53858d | 2015-08-12 15:49:59 -0700 | [diff] [blame] | 345 | alt=""/>Android Plugin for Gradle, Revision 1.3.1</a> <em>(August 2015)</em> |
| 346 | </p> |
| 347 | |
| 348 | <div class="toggle-content-toggleme"> |
| 349 | |
| 350 | <dl> |
| 351 | <dt>Dependencies:</dt> |
| 352 | |
| 353 | <dd> |
| 354 | <ul> |
| 355 | <li>Gradle 2.2.1 or higher.</li> |
| 356 | <li>Build Tools 21.1.1 or higher.</li> |
| 357 | </ul> |
| 358 | </dd> |
| 359 | |
| 360 | <dt>General Notes:</dt> |
| 361 | <dd> |
| 362 | <ul> |
| 363 | <li>Fixed the <a href="{@docRoot}tools/help/zipalign.html">ZipAlign</a> task to properly |
| 364 | consume the output of the previous task when using a customized filename. </li> |
| 365 | <li>Fixed <a href="{@docRoot}guide/topics/renderscript/compute.html">Renderscript</a> |
| 366 | packaging with the <a href="{@docRoot}tools/sdk/ndk/index.html">NDK</a>. </li> |
Cheryl Potter | 8ac5c1d | 2015-11-19 15:05:21 -0800 | [diff] [blame] | 367 | <li>Maintained support for the <code>createDebugCoverageReport</code> build task. </li> |
Rich Slogar | d53858d | 2015-08-12 15:49:59 -0700 | [diff] [blame] | 368 | <li>Fixed support for customized use of the <code>archiveBaseName</code> property |
| 369 | in the <code>build.gradle</code> build> file. </li> |
| 370 | <li>Fixed the <code>Invalid ResourceType</code> |
| 371 | <a href="{@docRoot}tools/help/lint.html">lint</a> warning caused by parameter method |
| 372 | annotation lookup when running |
| 373 | <a href="{@docRoot}tools/help/lint.html">lint</a> outside of Android Studio.</li> |
| 374 | </ul> |
| 375 | </dd> |
| 376 | </div> |
| 377 | </div> |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | <div class="toggle-content closed"> |
| 383 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 384 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | 3da2092 | 2015-07-16 13:45:41 -0700 | [diff] [blame] | 385 | alt=""/>Android Plugin for Gradle, Revision 1.3.0</a> <em>(July 2015)</em> |
| 386 | </p> |
| 387 | |
| 388 | <div class="toggle-content-toggleme"> |
| 389 | |
| 390 | <dl> |
| 391 | <dt>Dependencies:</dt> |
| 392 | |
| 393 | <dd> |
| 394 | <ul> |
| 395 | <li>Gradle 2.2.1 or higher.</li> |
| 396 | <li>Build Tools 21.1.1 or higher.</li> |
| 397 | </ul> |
| 398 | </dd> |
| 399 | |
| 400 | <dt>General Notes:</dt> |
| 401 | <dd> |
| 402 | <ul> |
| 403 | <li>Added support for the <code>com.android.build.threadPoolSize</code> property to control |
Rich Slogar | 2764015 | 2015-07-31 10:00:17 -0700 | [diff] [blame] | 404 | the <code>Android</code> task thread pool size from the <code>gradle.properties</code> file |
| 405 | or the command line. The following example sets this property to 4. |
Rich Slogar | 3da2092 | 2015-07-16 13:45:41 -0700 | [diff] [blame] | 406 | <pre> |
| 407 | -Pcom.android.build.threadPoolSize=4 |
| 408 | </pre> |
| 409 | </li> |
| 410 | <li>Set the default build behavior to exclude <code>LICENSE</code> and <code>LICENSE.txt</code> |
| 411 | files from APKs. To include these files in an APK, remove these files from the |
| 412 | <code>packagingOptions.excludes</code> property in the <code>build.gradle</code> file. |
| 413 | For example: |
| 414 | <pre> |
| 415 | android { |
| 416 | packagingOptions.excludes = [] |
| 417 | } |
| 418 | </pre> |
| 419 | </li> |
| 420 | <li>Added the <code>sourceSets</code> task to inspect the set of all available source sets. </li> |
| 421 | <li>Enhanced unit test support to recognize multi-flavor and |
| 422 | <a href="{@docRoot}tools/building/configuring-gradle.html#workBuildVariants"> |
| 423 | build variant</a> source folders. For example, to test an app with multi-flavors |
| 424 | <code>flavor1</code> and <code>flavorA</code> with the <code>Debug</code> build type, |
| 425 | the test source sets are: |
| 426 | <ul> |
| 427 | <li>test </li> |
| 428 | <li>testFlavor1 </li> |
| 429 | <li>testFlavorA </li> |
| 430 | <li>testFlavor1FlavorA </li> |
| 431 | <li>testFlavor1FlavorADebug </li> |
| 432 | </ul> |
| 433 | <p>Android tests already recognized multi-flavor source folders. </p> </li> |
| 434 | <li>Improved unit test support to:</p> |
| 435 | <ul> |
| 436 | <li>Run <code>javac</code> on main and test sources, even if the <code>useJack</code> |
| 437 | property is set to <code>true</code> in your build file. </li> |
| 438 | <li>Correctly recognize dependencies for each build type. </li> |
| 439 | </ul> |
| 440 | </li> |
| 441 | <li>Added support for specifying instrumentation test-runner arguments from the command line. |
| 442 | For example: |
| 443 | <pre> |
| 444 | ./gradlew connectedCheck \ |
| 445 | -Pandroid.testInstrumentationRunnerArguments.size=medium \ |
| 446 | -Pandroid.testInstrumentationRunnerArguments.class=TestA,TestB |
| 447 | </pre> |
| 448 | </li> |
| 449 | <li>Added support for arbitrary additional Android Asset Packaging Tool (AAPT) parameters |
| 450 | in the <code>build.gradle</code> file. For example: |
| 451 | <pre> |
| 452 | android { |
| 453 | aaptOptions { |
| 454 | additionalParameters "--custom_option", "value" |
| 455 | } |
| 456 | } |
| 457 | </pre> |
| 458 | </li> |
| 459 | |
| 460 | <li>Added support for a <a href="{@docRoot}tools/studio/studio-features.html#test-module"> |
| 461 | test APK module</a> as a separate test module, using the |
| 462 | <code>targetProjectPath</code> and <code>targetVariant</code> properties to set the APK |
| 463 | path and target variant. |
| 464 | <p class="note"><strong>Note:</strong> A test APK module does not support product |
| 465 | flavors and can only target a single variant. Also, Jacoco is not supported yet.</p> |
| 466 | </li> |
| 467 | <li>Added resource name validation before merging resources. </li> |
| 468 | <li>When building an AAR (Android ARchive) package for library modules, do not provide an |
| 469 | automatic <code>@{applicationId}</code> placeholder in the |
| 470 | <a href="{@docRoot}tools/building/manifest-merge.html">manifest merger</a> settings. |
| 471 | Instead, use a different placeholder, such as <code>@{libApplicationId}</code> and |
| 472 | provide a value for it if you want to include application Ids in the archive library. </li> |
| 473 | |
| 474 | </ul> |
| 475 | </dd> |
| 476 | </div> |
| 477 | </div> |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | <div class="toggle-content closed"> |
| 483 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 484 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | e5eceef | 2015-03-30 13:33:38 -0700 | [diff] [blame] | 485 | alt=""/>Android Plugin for Gradle, Revision 1.2.0</a> <em>(April 2015)</em> |
| 486 | </p> |
| 487 | |
| 488 | <div class="toggle-content-toggleme"> |
| 489 | |
| 490 | <dl> |
| 491 | <dt>Dependencies:</dt> |
| 492 | |
| 493 | <dd> |
| 494 | <ul> |
| 495 | <li>Gradle 2.2.1 or higher.</li> |
| 496 | <li>Build Tools 21.1.1 or higher.</li> |
| 497 | </ul> |
| 498 | </dd> |
| 499 | |
| 500 | <dt>General Notes:</dt> |
| 501 | <dd> |
| 502 | <ul> |
| 503 | <li>Enhanced support for running unit tests with Gradle. </li> |
| 504 | <ul> |
| 505 | <li>Added support to include Java-style resources in the classpath when running unit |
| 506 | tests directly from Gradle. |
| 507 | </li> |
| 508 | <li>Added unit test dependency support for Android ARchive (AAR) artifacts. |
| 509 | </li> |
| 510 | <li>Added support for the <code>unitTestVariants</code> property so unit test variants |
| 511 | can be manipulated using the <code>build.gradle</code> file. |
| 512 | </li> |
| 513 | <li>Added the <code>unitTest.all</code> code block under <code>testOptions</code> to |
| 514 | configure customized tasks for unit test. The following sample code shows how to add |
| 515 | unit test configuration settings using this new option: |
| 516 | <pre> |
| 517 | android { |
| 518 | testOptions { |
| 519 | unitTest.all { |
| 520 | jvmArgs '-XX:MaxPermSize=256m' // Or any other gradle option. |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | </pre> |
| 525 | </li> |
| 526 | <li>Fixed the handling of enums and public instance fields in the packaging of the |
| 527 | <code>mockable-android.jar</code> file. |
| 528 | </li> |
| 529 | <li>Fixed library project task dependencies so test classes recompile after changes. |
| 530 | </li> |
| 531 | </ul> |
| 532 | <li>Added the <code>testProguardFile</code> property to apply |
| 533 | <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> files when minifying a test APK. |
| 534 | </li> |
| 535 | <li>Added the <code>timeOut</code> property to the <code>adbOptions</code> code block |
| 536 | for setting the maximum recording time for |
| 537 | <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> screen recording. |
| 538 | </li> |
| 539 | <li>Added support for 280 dpi resources. |
| 540 | </li> |
| 541 | <li>Improved performance during project evaluation. |
| 542 | </li> |
| 543 | </ul> |
| 544 | </dd> |
| 545 | </div> |
| 546 | </div> |
| 547 | |
| 548 | |
| 549 | <div class="toggle-content closed"> |
| 550 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 551 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | d532233 | 2015-03-06 16:12:26 -0800 | [diff] [blame] | 552 | alt=""/>Android Plugin for Gradle, Revision 1.1.3</a> <em>(March 2015)</em> |
| 553 | </p> |
| 554 | |
| 555 | <div class="toggle-content-toggleme"> |
| 556 | |
| 557 | <dl> |
| 558 | <dt>Dependencies:</dt> |
| 559 | |
| 560 | <dd> |
| 561 | <ul> |
| 562 | <li>Gradle 2.2.1 or higher.</li> |
| 563 | <li>Build Tools 21.1.1 or higher.</li> |
| 564 | </ul> |
| 565 | </dd> |
| 566 | |
| 567 | <dt>General Notes:</dt> |
| 568 | <dd> |
| 569 | <ul> |
| 570 | <li>Fixed issue with duplicated dependencies on a test app that triggered a ProGuard failure. </li> |
| 571 | <li>Fixed Comparator implementation which did not comply with the JDK Comparator contract and |
| 572 | generated a JDK 7 error.</li> |
| 573 | </ul> |
| 574 | </dd> |
| 575 | </div> |
| 576 | </div> |
| 577 | |
| 578 | |
| 579 | <div class="toggle-content closed"> |
| 580 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 581 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | 5fcfe20 | 2015-02-23 10:22:22 -0800 | [diff] [blame] | 582 | alt=""/>Android Plugin for Gradle, Revision 1.1.2</a> <em>(February 2015)</em> |
| 583 | </p> |
| 584 | |
| 585 | <div class="toggle-content-toggleme"> |
| 586 | |
| 587 | <dl> |
| 588 | <dt>Dependencies:</dt> |
| 589 | |
| 590 | <dd> |
| 591 | <ul> |
| 592 | <li>Gradle 2.2.1 or higher.</li> |
| 593 | <li>Build Tools 21.1.1 or higher.</li> |
| 594 | </ul> |
| 595 | </dd> |
| 596 | |
| 597 | <dt>General Notes:</dt> |
| 598 | <dd> |
| 599 | <ul> |
| 600 | <li>Normalized path when creating a mockable JAR for unit testing. </li> |
| 601 | <li>Fixed the <code>archivesBaseName</code> setting in the <code>build.gradle</code> file. </li> |
| 602 | <li>Fixed the unresolved placeholder failure in manifest merger when building a library |
| 603 | test application.</li> |
| 604 | </ul> |
| 605 | </dd> |
| 606 | </div> |
| 607 | </div> |
| 608 | |
| 609 | |
| 610 | |
Rich Slogar | 5fcfe20 | 2015-02-23 10:22:22 -0800 | [diff] [blame] | 611 | <div class="toggle-content closed"> |
| 612 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 613 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | 5fcfe20 | 2015-02-23 10:22:22 -0800 | [diff] [blame] | 614 | alt=""/>Android Plugin for Gradle, Revision 1.1.1</a> <em>(February 2015)</em> |
| 615 | </p> |
| 616 | |
| 617 | <div class="toggle-content-toggleme"> |
| 618 | |
| 619 | <dl> |
| 620 | <dt>Dependencies:</dt> |
| 621 | |
| 622 | <dd> |
| 623 | <ul> |
| 624 | <li>Gradle 2.2.1 or higher.</li> |
| 625 | <li>Build Tools 21.1.1 or higher.</li> |
| 626 | </ul> |
| 627 | </dd> |
| 628 | |
| 629 | <dt>General Notes:</dt> |
| 630 | <dd> |
| 631 | <ul> |
| 632 | <li>Modified build variants so only variants that package a |
| 633 | <a href="{@docRoot}training/wearables/apps/index.html">Wear</a> app trigger Wear-specific |
| 634 | build tasks. </li> |
| 635 | <li>Changed dependency related issues to fail at build time rather than at debug time. |
| 636 | This behavior allows you to run diagnostic diagnostic tasks (such as 'dependencies') to help |
| 637 | resolve the conflict. </li> |
| 638 | <li>Fixed the <code>android.getBootClasspath()</code> method to return a value. </li> |
| 639 | </ul> |
| 640 | </dd> |
| 641 | </div> |
| 642 | </div> |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | <div class="toggle-content closed"> |
| 649 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 650 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 651 | alt=""/>Android Plugin for Gradle, Revision 1.1.0</a> <em>(February 2015)</em> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 652 | </p> |
| 653 | |
| 654 | <div class="toggle-content-toggleme"> |
| 655 | |
| 656 | <dl> |
| 657 | <dt>Dependencies:</dt> |
| 658 | |
| 659 | <dd> |
| 660 | <ul> |
| 661 | <li>Gradle 2.2.1 or higher.</li> |
| 662 | <li>Build Tools 21.1.1 or higher.</li> |
| 663 | </ul> |
| 664 | </dd> |
| 665 | |
| 666 | <dt>General Notes:</dt> |
| 667 | <dd> |
| 668 | <ul> |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 669 | <li>Added new unit test support</li> |
| 670 | <ul> |
| 671 | <li>Enabled |
| 672 | <a href="{@docRoot}training/activity-testing/activity-unit-testing.html">unit tests</a> to |
| 673 | run on the local JVM against a special version of the <code>android.jar</code> file that is |
| 674 | compatible with popular mocking frameworks, for example Mockito. </li> |
| 675 | <li>Added new test tasks <code>testDebug</code>, <code>testRelease</code>, and |
| 676 | <code>testMyFlavorDebug</code> when using product flavors. </li> |
| 677 | <li>Added new source folders recognized as unit tests: <code>src/test/java/</code>, |
| 678 | <code>src/testDebug/java/</code>, <code>src/testMyFlavor/java/</code>. |
| 679 | <li>Added new configurations in the <code>build.gradle</code> file for declaring test-only |
| 680 | dependencies, for example, <code>testCompile 'junit:junit:4.11'</code>, |
| 681 | <code>testMyFlavorCompile 'some:library:1.0'</code>. |
| 682 | <p class="note"><strong>Note:</strong> Test-only dependencies are not currently compatible |
| 683 | with Jack (Java Android Compiler Kit). </p> |
| 684 | </li> |
| 685 | <li>Added the <code>android.testOptions.unitTests.returnDefaultValues</code> option to |
| 686 | control the behaviour of the mockable android.jar. </li> |
| 687 | </ul> |
| 688 | <li>Replaced <code>Test</code> in test task names with <code>AndroidTest</code>. |
| 689 | For example, the <code>assembleDebugTest</code> task is now |
| 690 | <code>assembleDebugAndroidTest</code> task. Unit test tasks still have <code>UnitTest</code> |
| 691 | in the task name, for example <code>assembleDebugUnitTest</code>. </li> |
| 692 | <li>Modified <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> configuration files to |
| 693 | no longer apply to the test APK. If minification is enabled, ProGuard processes the test APK |
| 694 | and applies only the mapping file that is generated when minifying the main APK. </li> |
| 695 | <li>Updated dependency management</li> |
| 696 | <ul> |
| 697 | <li>Fixed issues using <code>provided</code> and <code>package</code> scopes. |
| 698 | <p class="note"><strong>Note:</strong> These scopes are incompatible with AAR |
| 699 | (Android ARchive) packages and will cause a build with AAR packages to fail.</p> |
| 700 | </li> |
| 701 | <li>Modified dependency resolution to compare the dependencies of an app under test and the |
| 702 | test app. If an artifact with the same version is found for both apps, it's not included with |
| 703 | the test app and is packaged only with the app under test. If an artifact with a different |
| 704 | version is found for both apps, the build fails.</li> |
| 705 | </ul> |
| 706 | |
| 707 | <li>Added support for <code>anyDpi</code> |
| 708 | <a href="{@docRoot}guide/topics/resources/providing-resources.html"> resource qualifier</a> |
| 709 | in resource merger. </li> |
| 710 | <li>Improved evaluation and IDE sync speeds for projects with a large number of |
| 711 | Android <a href="{@docRoot}sdk/installing/create-project.html#CreatingAModule"> modules</a>. </li> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 712 | </ul> |
| 713 | </dd> |
| 714 | </div> |
| 715 | </div> |
| 716 | |
| 717 | |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 718 | <div class="toggle-content closed"> |
| 719 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 720 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 721 | alt=""/>Android Plugin for Gradle, Revision 1.0.1</a> <em>(January 2015)</em> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 722 | </p> |
| 723 | |
| 724 | <div class="toggle-content-toggleme"> |
| 725 | |
| 726 | <dl> |
| 727 | <dt>Dependencies:</dt> |
| 728 | |
| 729 | <dd> |
| 730 | <ul> |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 731 | <li>Gradle 2.2.1 up to 2.3.x. |
| 732 | <p class="note"><strong>Note:</strong> This version of the Android Plugin for Gradle is |
| 733 | not compatible with Gradle 2.4 and higher. </p> |
| 734 | </li> |
| 735 | <li>Build Tools 21.1.1 or higher.</li> |
| 736 | </ul> |
| 737 | </dd> |
| 738 | |
| 739 | <dt>General Notes:</dt> |
| 740 | <dd> |
| 741 | <ul> |
| 742 | <li>Fixed issue with Gradle build failure when accessing the |
| 743 | <code>extractReleaseAnnotations</code> module. |
| 744 | (<a href="http://b.android.com/81638">Issue 81638</a>).</li> |
| 745 | <li>Fixed issue with <code>Disable</code> passing the |
| 746 | <code>--no-optimize</code> setting to the Dalvik Executable (dex) bytecode. |
| 747 | (<a href="http://b.android.com/82662">Issue 82662</a>).</li> |
| 748 | <li>Fixed manifest merger issues when importing libraries with a |
| 749 | <code>targetSdkVersion</code> less than 16.</li> |
| 750 | <li>Fixed density ordering issue when using Android Studio with JDK 8.</li> |
| 751 | </ul> |
| 752 | </dd> |
| 753 | </div> |
| 754 | </div> |
| 755 | |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 756 | <div class="toggle-content closed"> |
| 757 | <p><a href="#" onclick="return toggleContent(this)"> |
smain@google.com | 2b903d0 | 2016-03-16 12:13:05 -0700 | [diff] [blame] | 758 | <img src="{@docRoot}assets/images/styles/disclosure_down.png" class="toggle-content-img" |
Rich Slogar | ed1cf52 | 2015-02-18 13:09:43 -0800 | [diff] [blame] | 759 | alt=""/>Android Plugin for Gradle, Revision 1.0.0</a> <em>(December 2014)</em> |
| 760 | </p> |
| 761 | |
| 762 | <div class="toggle-content-toggleme"> |
| 763 | |
| 764 | <dl> |
| 765 | <dt>Dependencies:</dt> |
| 766 | |
| 767 | <dd> |
| 768 | <ul> |
| 769 | <li>Gradle 2.2.1 up to 2.3.x. |
| 770 | <p class="note"><strong>Note:</strong> This version of the Android Plugin for Gradle is |
| 771 | not compatible with Gradle 2.4 and higher. </p> |
| 772 | </li> |
Rich Slogar | 3150bb7 | 2015-01-14 16:04:08 -0800 | [diff] [blame] | 773 | <li>Build Tools 21.1.1 or higher.</li> |
| 774 | </ul> |
| 775 | </dd> |
| 776 | |
| 777 | <dt>General Notes:</dt> |
| 778 | <dd> |
| 779 | <ul> |
| 780 | <li>Initial plugin release.</li> |
| 781 | </ul> |
| 782 | </dd> |
| 783 | </div> |
Adarsh Fernando | b896cd1 | 2016-04-05 10:26:08 -0700 | [diff] [blame] | 784 | </div> |