Dependency Analysis Plugin Changelog
- Test against Gradle 7.1.
- Test against AGP 4.2.1 and 7.0.0-beta04.
- [Fixed] Correctly associate compiled binaries with source files and the source sets they live in. (#393)
- [Fixed] Builds with non-strict mode should not fail on strict-mode-only issues. (#397)
- [Fixed] Tasks with
@Option
arguments should be annotated with@Input
. Thanks to eugene-krivobokov for this fix. (PR #413) - [Fixed] Unused
testImplementation
dependencies should be detected. (#366) - Use the BIN distribution of Gradle 6.9. Thanks to Vladimir Sitnikov for this enhancement.
- [Fixed] Detect usage of annotations on type parameters (#372)
- Remove deprecated functions.
-
[New] Non-strict mode which helps to keep compile graphs smaller than with the default strict mode.
// root build.gradle[.kts] dependencyAnalysis { strictMode(false) // default is true }
-
[New] Compute some basic build health metrics, based on size and shape of the compile-classpath graphs.
-
Remove all the JCenter references missed the first time around.
- [New] Make it easier to make changes incrementally by introducing the concept of "ripples." A
ripple can occur if you downgrade a dependency (remove it or update it from
api
toimplementation
), and this removes that dependency from the compilation classpath of a dependent project that was using that dependency without having declared it. Use like:
./gradlew ripples --id :some-project
- Bumped Kotlin to 1.4.21.
- Now building with and testing against Gradle 6.8.2.
- Updated to latest AGPs at time of writing (4.1.2, 4.2.0-beta04, 7.0.0-alpha05).
- Removed all references to jcenter.
- [Fixed] Assume dependencies on some variant (e.g.
debugImplementation
vsimplementation
) are correctly on that variant. (#340) - [Fixed] Don't duplicate section headers in
advice-console.txt
. (#318) - [Fixed] Use absolute-path sensitivity for artifact file paths. (#350)
- [Fixed] File dependencies now trim the prefix path in order to provide a unique identification.
- [Fixed] Exclusively use the compile classpath for resolving dependencies, filtering out constraints.
- [Fixed] Don't use an enforced platform for the Kotlin BOM. This will permit use of the Kotlin compiler daemon for projects using Kotlin 1.4+. (#333)
- Now building with and testing against Gradle 6.7.1.
- Update supported version of AGP 4.2.0 to beta01.
Thanks to Stephane Nicolas @stephanenicolas for helping keep AGP up to date, and for the many discussions.
- [Fixed] Improved analysis of annotations for ABI reporting.
- [Fixed] Be null-safe.
- [Fixed] Annotations on public classes, public methods, and parameters of public methods are part of the ABI. (#296)
- [New] Visualize project dependencies and reverse-dependencies (dependents) with
./gradlew :projectGraphReport
or see the dependents of a specific project with
./gradlew :projectGraphReport --id :my-project
The resultant dot files can be converted to svg by installing graphviz and executing
dot -Tsvg path/to/file.gv -o output.svg
- [New] Configure artifacts-clearing behavior with a new system property,
dependency.analysis.clear.artifacts=<true|false>
. This can be added to the command line invocation or added togradle.properties
. Default istrue
. (#321)
- [Fixed] Remove task execution listener. It wasn't doing anything useful and was incompatible with the configuration cache.
- [Fixed] Optimize GraphBuilder algorithm to dramatically improve performance.
- [New] Run
./gradlew :ripples
to see expected downstream impacts from upstream changes. - [New] Colorize console output (only used experimentally in
ripples
right now). - [Fixed] Detect imports in Kotlin source even when @file: is used.
- [Fixed] Filter out Java Platform modules when creating transitive-use relations.
- [Fixed] LocateDependenciesTask should not resolve dependencies.
- [New] Detect Android lint-only dependencies and do not suggest removing them. (#303)
- [New] Will now ignore not-well-known configurations. (#300)
- [New] Firebase is now part of a dependency bundle by default. (#305)
- [New] ABI dump output is now more accessible to end-users.
- [New]
Reason
now includes more information about dependencies, specifically Android manifest components and security providers. - [Fixed] Safe-cast to
ProjectDependency
to prevent mysterious NPE. (#295) - [Fixed] Dependency graph doesn't show flat jars.
- Improved console output.
- Improved exception message when build is configured to fail.
- Now building with Gradle 6.7.
Thanks to Vladimir Sitnikov @vlsi for discussing several issues and reviewing PRs for this release.
- [New] New
:proj:projectHealth
task added to each subproject/module in a build. This is a new primary end-user target and will respect the user-definedseverity
behavior, similar to:buildHealth
. Furthermore, the:failOrWarn
task has been removed, and now:buildHealth
will simply fail itself. (Issue 273) - [Fixed] Flat jar file dependencies mis-reported in several interesting ways.
- Updated to latest AGPs at time of writing (4.1.0-rc03 and 4.2.0-alpha12)
- [Fixed] Does not union global and local rules as expected. (Issue 273)
- [Fixed] In-memory cache now has a configurable eviction policy. (Issue 274)
- [Fixed] Sometimes a dependency can appear multiple times in the advice.
- [New] Kotlin stdlib now a dependency bundle by default, improving ergonomics for Kotlin users.
- [New] Improved on reason experimental feature. Try it out:
./gradlew proj:reason --id com.squareup.okio:okio
- Do less work during configuration.
- [New] New experimental feature to provide insight into the reason for the plugin's advice. For example:
./gradlew proj:reasonDebug --id com.squareup.okio:okio
- [Fixed] Fails to recognize when dependencies have been declared on multiple configurations. (Issue 257)
- [Fixed] Eagerly realizing tasks.
- Updated to latest AGPs at time of writing (4.1.0-rc02 and 4.2.0-alpha09)
- Updated test matrix to run against Gradle 6.6.1.
- [Fixed] LocateDependenciesTask remains up to date even after changing dependency configurations (Issue 255).
- [Fixed] Works better with Kotlin Multiplatform Projects (Issue 228). (Thank you to Martin Bonnin @martinbonnin for contributing this!)
- [Fixed] AARs with only native libs wrongly declared unused (Issue 252).
- [Fixed] Don't try to analyze
module-info.class
files. (Issue 239)
- [Fixed] Unhook plugin from
assemble
task, to which it was yoked against its will. The upshot is that runningassemble
will no longer trigger the plugin's tasks to run. Using the Build Project button in Android Studio will also no longer trigger the plugin's tasks. - [Fixed] Don't do too much work during configuration for the
LocateDependenciesTask
. - No longer disable plugin configuration when in the context of Android Studio. This was causing more problems than it solved (and may not even have solved anything).
- Improved warning message about using a version of AGP outside of the known-good range.
- Don't call
await()
onWorkerExecutor
s, which should improve runtime performance, and was unnecessary anyway.
- [Fixed] Crashes in the presence of file dependencies (flat jars).
- Improved efficiency in bytecode analysis, which should reduce memory pressure and CPU usage.
- [Fixed] Inadvertently built 0.53.0 with Java 9, which leads to compatibility issues with projects that use Java 8.
- [New] Improved support for Spring Boot and Kotlin Multiplatform Projects. This plugin no longer
relies on the
jar
task, which is disabled by these plugins. Instead, it uses compiled class files as its input. - [New] The plugin will not suggest
api
dependencies for Spring Boot projects. - Now built with Gradle 6.5.1.
- Now compiling against AGP 4.0.1 and testing against AGPs 3.5.4, 3.6.4, and 4.0.1.
- [New] Provide suggested fix on Android unit test compilation failure. Partially resolves Issue 205.
- [Fixed] Android Studio reports configuration failure due to changes in 0.50.0.
- [Fixed] Don't suggest changing an implementation dependency to testImplementation when it is actually used in the main source.
- Now compiling against AGP 4.0.0.
- [Fixed] Don't crash when unit test variants have been disabled. (Thank you to Stephane Nicolas @stephanenicolas for contributing this!)
- [New] Plugin disables itself if invoked from the IDE, to workaround an issue with Android Studio's
Make project
. - [New] You can disable most console output with a new system property,
dependency.analysis.silent=true
. This can be added to the command line invocation or added togradle.properties
.
- [Fixed] Detect star imports as supported annotation types.
- [Fixed] Detect if jar task has been disabled and provide more useful error message if so.
- [New] Analyze test source in order to provide advice relating to test dependencies.
- Updated to latest AGPs at time of writing (4.1.0-beta01 and 4.2.0-alpha01)
- Deprecated 'master' branch in favor of new 'main' branch.
- [New] The concept of dependency "facades" has been formalized as "logical dependencies", aka
"bundles".
dependencyAnalysis.setFacadeGroups()
is now deprecated and is a no-op. Users should instead usedependencyAnalysis.dependencies {}
to specify their bundles. Finally, with this change, the Kotlin stdlib family is no longer considered a bundle by default. (Thanks to Zac Sweers @ZacSweers for talking with me about how to name this new feature) - Simplified and reduced the amount of logging.
- Building with Gradle 6.5. Added Gradle 6.5 to the test matrix.
- [New] New
registerPostProcessingTask()
method on the extension to register a custom task to execute with theComprehensiveAdvice
produced by the project as an input. - [New] Can now filter/configure compileOnly advice, analogous to other kinds of advice.
- [New] Improved DSL for configuring plugin behavior. See the wiki for more information. (Thank you to Stephane Nicolas @stephanenicolas for contributing this!)
- Updated to latest AGPs at time of writing (4.0.0!).
- [New] All advice, both dependency- and plugin-related, is now aggregated at the project level for
easier consumption. The extension methods
adviceOutputFor(variant: String)
has been changed toadviceOutput()
. It no longer returns a nullableRegularFileProperty
. This output is now always non-null, but may nevertheless contain a null value, so you should usegetOrElse()
. Finally, the type of the output has changed fromSet<Advice>
toSet<ComprehensiveAdvice>
. - [Fixed]
StringIndexOutOfBoundsException
when parsing empty source directory. - Several root-level aggregate tasks were removed as no longer useful.
- [New] Improved support for Android variants in dependency analysis. Plugin now analyzes all
source sets / variants for each execution of
buildHealth
. - [Fixed] Build cache issue with
ArtifactsAnalysisTask
. (Thanks to @Paladinium for filing the issue and providing a reproducer!) - [Deprecated] The
setVariants()
method is now deprecated; it no longer does anything, and will be removed in v1.0.0. - No longer attempts to parse Java stubs generated by kapt. No tests break, so ¯\_(ツ)_/¯
- Updated to latest AGPs at time of writing (4.0.0-rc01).
- Staging repo closing and release process is now semi-automated (with thanks to Niklas Baudy @vanniktech, https://github.com/vanniktech/gradle-maven-publish-plugin)
- [New] New
setDependencyRenamingMap()
method on the DSL allows customizing some output with semantic dependency names. See the javadoc for more information. More output will be mapped in a future release. (Thank you to Stephane Nicolas @stephanenicolas for contributing this!) - Building plugin with Gradle 6.4.1, and testing against same.
- Comment on PRs with build scan URL when there is a failure.
- [New] Support the
application
plugin. - [New] New
abi
exclusions DSL. See the wiki for details. (Thanks to Zac Sweers @ZacSweers for the contribution!) - [New] Detects usages that only appear in a generic context, and javadoc too (as a side effect).
- [New] Does not suggest removing dependencies that supply security providers (such as Conscrypt).
- Now publishing snapshots on every push to master.
- Building plugin with Gradle 6.4, and testing against same.
- Updated to latest AGP, 4.1.0-alpha09.
- [New] Supports the concept of "facade" dependencies. See the new wiki for details.
- Post-processing support has been improved. See the new wiki for details.
- Most of what was in the over-long readme has been moved to the wiki.
OutputPaths
is back to internal. We have a new way to make outputs available.- Updated to latest AGPs at time of writing (4.0.0-beta05, 4.1.0-alpha08).
- [New] Console report now stored on disk for easier human consumption. (Thank you to Stephane Nicolas @stephanenicolas for contributing this!)
- [New]
OutputPaths
is now non-internal atcom.autonomousapps.OutputPaths
. This makes it possible to consume plugin outputs without having to reference its tasks. - [New]
Advice
json for "remove" and "add" advice now indicates used-transitive dependencies (for the former) and parents or upstream dependencies (for the latter). - [Fixed] Reports Java service loaders as unused. Due to their runtime nature, they will now be filtered from the unused dependencies advice.
- Updated to latest AGPs at time of writing (3.6.3, 4.0.0-beta04, 4.1.0-alpha06).
- Added a CONTRIBUTING guide (Thank you to Stephane Nicolas @stephanenicolas for assisting with this)
- [New] Reports when kapt has been applied but there are no annotation processors present.
- [New] Reports when either the
java-library
ororg.jetbrains.kotlin.jvm
have been redundantly applied. Laid the groundwork for reporting other plugin issues. - [Fixed] Reports unused dependencies that are on a flavor-based configuration as being on a "null" configuration.
- Re-organized the model code. In particular, moved
Advice
andDependency
to a non-internal package. These should now be considered part of the plugin's public API. - Added an "intermediates" directory to the output, so it's more clear to end-users which files they should care about.
- [Fixed] Plugin now correctly detects usage of annotation processors that support annotations with
SOURCE
retention policies. - Updated asm dependency to 8.0.1 (shaded).
Please note that this version is only available via Maven Central, as there were issues publishing to the Gradle Plugin Portal.
- [New] Support kotlin-jvm projects.
- [Fixed] False positive on unused annotation processors.
- [Fixed] Poor performance in
MisusedDependencyDetector
. (special thanks to Stephane Nicolas @stephanenicolas for discussing this issue with me)
- [New] Reports unused annotation processors.
- [New] Tries to be more memory-efficient by interning strings.
- [New] Tries to be more memory-efficient by using in-memory cache to avoid duplicate (simultaneous) work.
- [New] No longer fails when used outside of known-good AGP range. Instead emits warning.
- [New] New extension method
chatty()
lets users set console logging preference. - [Fixed] Don't use default Locale when capitalizing strings.
- [Fixed] Plugin gives redundant advice (suggests moving compileOnly dep to compileOnly). This impacted both console output and advice.json.
- Plugin no longer eagerly fails if a version of AGP is used outside of the known-good range. Instead it emits a warning.
- [Fixed] Check for presence of ContentProvider or Service in contributed Android manifests. Such Android libraries are now considered used, even if they don't appear in the compiled classes of a project. (nb: this ensures LeakCanary is not considered unused.)
- [Fixed] Reports appcompat as unused when its resources are (but not by Java/Kotlin source).
- [Fixed] Deprecation warning with AGP 4+ for
android.viewBinding
andandroid.dataBinding
. Fixed issue withAgpVersion
comparisons.
- Added extension option for ignoring "-ktx" dependencies. See README for more information.
- [Fixed] Version badge showed a very old version. (Thanks Pavlos-Petros Tournaris!)
- [Fixed] Emit helpful error message if plugin has not been applied to root project.
- [Fixed] Provide advice for source-containing root projects.
- [Fixed] Subtle bug that led to unused dependencies showing up in change-advice.
- Plugin now available on Maven Central in addition to Gradle Plugin Portal.
- Plugin supports a new configuration option to not auto-apply to all subprojects.
- [Fixed] Now supports AGP 4.1.0-alpha04.
- [Fixed] Issue 82. Build fails with StringIndexOutOfBoundsException.
- [Feature] The plugin will warn the user and throw an explicit error if it is applied to a project outisde the range of accepted AGP versions (3.5.3-4.1.0-alpha08 at time of writing).
- [Fixed] Deprecation warnings on projects built with AGP 4+, due to accessing 3.x-era
android.dataBinding
andandroid.viewBinding
.
- There is no version 0.27.0, as there were issues with publishing to the Gradle Plugin Portal.
- [Feature] The plugin now detects if databinding or viewbinding have been enabled and, of so, does not suggest changing dependencies automatically added by AGP.
- There is no version 0.26.0, as there were issues with publishing to the Gradle Plugin Portal.
- [Fixed] Support for AGP 4.1.0-alpha02.
- [Fixed] Should not assume every class has a superclass.
- [Fixed] Crashes when configuring project with Java-only Android application module.
- [Feature] Added support for recognizing potential
compileOnly
dependencies, such as source/class annotation libraries. - Simplified source code parsing so it's only done once.
- [Fixed] Forgot to close an input stream on a collection of files.
- [Fixed] Runtime issue during configuration for some projects.
- Now testing against Gradle 6.2.2.
- Bumped Kotlin to 1.3.70.
- [Fixed] Runtime issue with custom variant and java-library subproject.
- [Fixed] ConstantDetector task fails at runtime.
- [Fixed] Plugin crashes with AGP 4.0.0-beta01.
- Functional tests updated to run against latest AGP 4.0.0 beta and Gradle 6.2.1.
- [Feature] Lifts limitation on detecting constant usage.
- There is no version 0.20.1, as there were issues with publishing to the Gradle Plugin Portal.
- There is no version 0.20.0, as there were issues with publishing to the Gradle Plugin Portal.
- [Feature] Extension offers more configuration options for detected issues.
- There is no version 0.19.1, as there were issues with publishing to the Gradle Plugin Portal.
- There is no version 0.19.0, as there were issues with publishing to the Gradle Plugin Portal.
- [Feature] Extension now offers basic configurable failure options.
- Bumped to Gradle 6.1.1, including functional tests matrix.
- Simplified console output.
- [Feature] Thorough advice now provided for how to update build scripts based on plugin findings. This is printed in narrative form as well as written to disk in a machine-readable format.
- Trimmed down README with a new focus on the advice-related tasks.
- [Fixed] Plugin doesn't detect namespaced Android resource usage. (nb: still does not detect non-namespaced res usage.)
- [Fixed] Plugin now works with AGP 4.0.0-alpha09.
- [Fixed] Plugin now works with AGP 4.0.0-alpha08.
- [Feature] Reports now indicate on which configuration a dependency was declared, if it were.
- [Fixed] Kotlin stdlib is never a candidate for unused direct dependency.
- Significantly more tests, alongside some refactoring.
- [Fixed] Kotlin stdlib never appears in list of used transitive dependencies.
- Added support for detecting use of Kotlin inline members.
- Reverted modularization of models & utils.
- (12) Generate outputs into buildDir/reports directory
- Normalize annotation of input AbiAnalysisTask
- (11) add version in transitive dependencies
- More robustness in Functional tests
- Extract models and utils to separate Gradle project ("module")
- Add resolved versions to all reports
- Clean up of Runner class
- Matrix of Functional tests for different AGP and Gradle versions
- Target Kotlin at Java 8
- Add test for ABI dependency analysis
- Use Java 8
- Add unit tests to some components
- Improved logging
- Refactor of jar/ClassList analysis tasks
- Refactor Gradle Runner
- Plugin should now be applied only to root project.
- Add extension for Aggregate BuildHealth Task
- Improved bytecode analysis
- Switched from aggregating tasks to aggregating configurations.
- (6) Changed file extension on some outputs to .json.
- (7) Use reified types
- Added abstract base class for android-project analysis
- Introduction of perpetual semantic versioning.
- Improve analysis of pure Java projects
- Apache 2.0 license
- Improved misused-dependencies report.
- Fixed an issue that impacted IDE sync.
- ABI analysis merged
- AGP 3.5.3
- Reports in HTML
- Improved cacheability of tasks
- AGP & KGP versions bump 3.5.2 & 1.3.61
- Gradle 5 and shaded ASM dependency
- Change handling of kotlin-stdlib artifacts
- ASM 7
- kapt support
- java-library projects support
- Better byte code analysis
- Analysis of XML layouts
- Gradle 6
- Function testing introduced (but doesn't work yet)
- Simplified ClassListAnalysisTask configuration.
October 23rd, 2019. Project starts.