Sundeep Gupta
Sundeep Gupta

Reputation: 1966

dependencies task not found with project.tasks.findByName

When I run gradle tasks it always lists dependencies task; But when I run the following code in my build.gradle it always return null : project.tasks.findByName('dependencies')

My requirement is to print the output of dependencies task into the log for reference as part of build.

I am on gradle version 1.11 (not authorized to upgrade)

Please help:

Upvotes: 1

Views: 1381

Answers (1)

Stanislav
Stanislav

Reputation: 28106

You may try to use a custom task of org.gradle.api.tasks.diagnostics.DependencyReportTask type, and configured to print just sepecified configuration dependencies, as:

task printDeps(type: org.gradle.api.tasks.diagnostics.DependencyReportTask) {
        configurations = project.buildscript.configurations + project.configurations
}

If you wish, you may exclude buildscript dependencies, if you don't need them.

Upvotes: 1

Related Questions