使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android Plugin for Gradle,修订版 1.1.0(2015 年 2 月)
- 依赖项:
|
最低版本 |
默认版本 |
备注 |
Gradle |
2.2.1 |
2.2.1 |
如需了解详情,请参阅更新 Gradle。 |
SDK Build Tools |
21.1.1 |
21.1.1 |
安装或配置 SDK Build Tools。 |
- 一般说明:
-
- 添加了新的单元测试支持
- 使用
AndroidTest
替换了测试任务名称中的 Test
。例如,assembleDebugTest
任务现在是 assembleDebugAndroidTest
任务。单元测试任务仍会在任务名称中包含 UnitTest
(例如 assembleDebugUnitTest
)。
- 修改了 ProGuard 配置文件,不再适用于测试 APK。如果启用了缩减大小功能,ProGuard 将处理测试 APK,且只会应用在缩减主 APK 大小时生成的映射文件。
- 更新了依赖项管理
- 在资源合并程序中添加了对
anyDpi
资源限定符的支持。
- 加快了对包含大量 Android 模块的项目的评估和 IDE 同步速度。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-27。
[null,null,["最后更新时间 (UTC):2025-08-27。"],[],[],null,["Android plugin for Gradle, revision 1.1.0 (February 2015)\n\nDependencies:\nGeneral Notes:\n:\n - Added new unit test support\n - Enabled [unit\n tests](/training/activity-testing/activity-unit-testing) to run on the local JVM against a special version of the `android.jar` file that is compatible with popular mocking frameworks, for example Mockito.\n - Added new test tasks `testDebug`, `testRelease`, and `testMyFlavorDebug` when using product flavors.\n - Added new source folders recognized as unit tests: `src/test/java/`, `src/testDebug/java/`, `src/testMyFlavor/java/`.\n - Added new configurations in the `build.gradle` file for declaring test-only dependencies, for example, `testCompile 'junit:junit:4.11'`, `testMyFlavorCompile 'some:library:1.0'`.\n\n **Note:** Test-only dependencies\n are not compatible with Jack (Java Android Compiler Kit).\n - Added the `android.testOptions.unitTests.returnDefaultValues` option to control the behaviour of the mockable android.jar.\n - Replaced `Test` in test task names with `AndroidTest`. For example, the `assembleDebugTest` task is now `assembleDebugAndroidTest` task. Unit test tasks still have `UnitTest` in the task name, for example `assembleDebugUnitTest`.\n - Modified [ProGuard](/tools/help/proguard) 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.\n - Updated dependency management\n - Fixed issues using `provided` and `package` scopes.\n\n **Note:** These scopes are\n incompatible with AAR (Android ARchive) packages and\n cause a build with AAR packages to fail.\n - 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.\n - Added support for `anyDpi` [resource\n qualifier](/guide/topics/resources/providing-resources) in resource merger.\n - Improved evaluation and IDE sync speeds for projects with a large number of Android [modules](/studio/projects)."]]