Giter Site home page Giter Site logo

xymelon / dependency-analysis-android-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from autonomousapps/dependency-analysis-gradle-plugin

0.0 0.0 0.0 46.52 MB

Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins

License: Apache License 2.0

Java 1.21% Groovy 32.07% Kotlin 63.18% ANTLR 3.54%

dependency-analysis-android-gradle-plugin's Introduction

Latest version
Latest snapshot
Build status

Detect unused and misused dependencies

The Dependency Analysis Gradle Plugin (DAGP, 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.).

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.

Build health

In addition to the dependency-related advice (see above), DAGP provides other advice to help maintain your "build health." This includes the detection of:

  1. Unnecessary plugins (currently only kapt).

  2. Subprojects ("modules") that unnecessarily use the Android plugin, and could instead by "normal" JVM libraries.

Compatibilities

Please see the wiki for information on the versions of Gradle, the Android Gradle Plugin, etc., that this plugin is compatible with.

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
}

dependency-analysis-android-gradle-plugin's People

Contributors

3flex avatar astro03 avatar autonomousapps avatar daanschipper avatar dcampogiani avatar fredloh avatar gabrielittner avatar hythloda avatar jjohannes avatar js92 avatar martinbonnin avatar mvegter avatar nsk-mironov avatar oheyadam avatar pavlospt avatar sboishtyan avatar simonmarquis avatar stephanenicolas avatar subhrajyotisen avatar twisterrob avatar vlsi avatar zacsweers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.