Android Plugin for Gradle,修订版 1.1.0(2015 年 2 月)
- 依赖项:
<dd>
<ul>
<li>Gradle 2.2.1 or higher.</li>
<li>Build Tools 21.1.1 or higher.</li>
</ul>
</dd>
<dt>General Notes:</dt>
<dd>
<ul>
<li>Added new unit test support</li>
<ul>
<li>Enabled
<a href="/training/activity-testing/activity-unit-testing">unit
tests</a> to run on the local JVM against a special version
of the <code>android.jar</code> file that is compatible with
popular mocking frameworks, for example Mockito.</li>
<li>Added new test tasks <code>testDebug</code>,
<code>testRelease</code>, and <code>testMyFlavorDebug</code>
when using product flavors.</li>
<li>Added new source folders recognized as unit tests:
<code>src/test/java/</code>, <code>src/testDebug/java/</code>,
<code>src/testMyFlavor/java/</code>.</li>
<li>Added new configurations in the <code>build.gradle</code> file
for declaring test-only dependencies, for example,
<code>testCompile 'junit:junit:4.11'</code>,
<code>testMyFlavorCompile 'some:library:1.0'</code>.
<p class="note"><strong>Note:</strong> Test-only dependencies
are not currently compatible with Jack (Java Android Compiler
Kit).</p></li>
<li>Added the
<code>android.testOptions.unitTests.returnDefaultValues</code>
option to control the behaviour of the mockable android.jar.</li>
</ul>
<li>Replaced <code>Test</code> in test task names with
<code>AndroidTest</code>. For example, the
<code>assembleDebugTest</code> task is now
<code>assembleDebugAndroidTest</code> task. Unit test tasks
still have <code>UnitTest</code> in the task name, for example
<code>assembleDebugUnitTest</code>.</li>
<li>Modified <a href="/tools/help/proguard">ProGuard</a>
configuration files to no longer apply to the test APK. If
minification is enabled, ProGuard processes the test APK and
applies only the mapping file that is generated when minifying
the main APK.</li>
<li>Updated dependency management
<ul>
<li>Fixed issues using <code>provided</code> and
<code>package</code> scopes.
<p class="note"><strong>Note:</strong> These scopes are
incompatible with AAR (Android ARchive) packages and will
cause a build with AAR packages to fail.</p></li>
<li>Modified dependency resolution to compare the dependencies of
an app under test and the test app. If an artifact with the
same version is found for both apps, it's not included with
the test app and is packaged only with the app under test. If
an artifact with a different version is found for both apps,
the build fails.</li>
</ul>
</li>
<li>Added support for <code>anyDpi</code>
<a href="/guide/topics/resources/providing-resources">resource
qualifier</a> in resource merger.</li>
<li>Improved evaluation and IDE sync speeds for projects with a
large number of Android <a href="/studio/projects">modules</a>.</li>
</ul>
</dd>