• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

autonomousapps/dependency-analysis-android-gradle-plugin: Gradle plugin for JVM ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

autonomousapps/dependency-analysis-android-gradle-plugin

开源软件地址(OpenSource Url):

https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin

开源编程语言(OpenSource Language):

Kotlin 59.7%

开源软件介绍(OpenSource Introduction):

Latest version
Latest snapshot
Build status

Detect unused and misused dependencies

The Dependency Analysis Gradle Plugin (née Dependency Analysis Android Gradle Plugin) detects the following:

  1. Unused dependencies.

  2. Used transitive dependencies (which you may want to declare directly).

  3. Dependencies declared on the wrong configuration (api vs implementation vs compileOnly, etc.).

  4. Unnecessary plugins (currently only kapt).

As a side effect, the plugin can also tell you your project’s ABI, and produces graphviz files representing various views of your dependency graph, among other things. These side effects are currently mostly undocumented internal behaviors, but they may be interesting for some advanced users.

Add to your project and use

For detailed instructions, see the wiki.

The simplest approach is to add the following:

root build.gradle
plugins {
  id 'com.autonomousapps.dependency-analysis' version "<<latest_version>>"
}

For a quick start, just run the following:

./gradlew buildHealth

More advanced usage

Project Health

You can also run the analysis against individual modules with the projectHealth task. For example:

./gradlew app:projectHealth

Reason

You may be curious why the plugin is emitting (or not emitting) advice regarding some dependency. You can ask it why:

./gradlew lib:reason --id com.squareup.okio:okio:2.2.2 (1)
> Task :lib:reason

----------------------------------------
You asked about the dependency 'com.squareup.okio:okio:2.2.2'.
There is no advice regarding this dependency.
----------------------------------------

Shortest path from :lib to com.squareup.okio:okio:2.2.2:
:lib
\--- com.squareup.okio:okio:2.2.2

Source: main
------------
* Exposes class okio.BufferedSource (implies api).
  1. The version string is optional.

Basic configuration

For detailed information on how to configure the plugin, see the wiki.

To configure the plugin, use the dependencyAnalysis extension.

build.gradle
dependencyAnalysis {
  // configuration goes here
}

Two models

At time of writing, there are two distinct models available for conducting dependency analysis. By default, from version 1.0.0-rc01, the plugin uses the "new model." With that version, you may switch to the "old model" via the system property dependency.analysis.old.model=true. That is also the final version of the plugin that supports use of the old model. From 1.0.0-rc02, the old model is no longer available.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap