简体   繁体   English

Gradle构建未使用的依赖项

[英]Gradle building unused dependencies

When using Gradle as a build tool for Android Projects like normally, does Gradle always build everything from a given dependency, or does it only build the things inside the dependency that you are using, together with the dependencies that these things might have underneath ? 当像往常一样将Gradle用作Android项目的构建工具时,Gradle总是从给定的依赖项构建所有内容,还是仅在您正在使用的依赖项中构建事物,以及这些事物可能在其下?

Does it skip building things that you are not using? 它会跳过构建您不使用的东西吗?

You have to build a gradle to fit that version of Android or to use api. 您必须构建一个gradle以适合该版本的Android或使用api。 I understand that it is not possible to omit the gradle build. 我了解无法省略gradle版本。

Yes , all code from a dependency is included in the build (.apk file). 是的 ,依赖项中的所有代码都包含在构建文件(.apk文件)中。

Unless you turn on tools that minimize or remove unused files / classes / functions. 除非打开最小化或删除未使用的文件/类/功能的工具。 For more on that subject: minimize code . 有关该主题的更多信息: 最小化代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM