Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

java - Is there Gradle "dependencies " task for buildScript dependencies?

One can run gradlew dependencies to learn about dependencies of module tasks. It there a way to find transitive dependencies of buildscript dependencies?

Example: classpath 'com.android.tools.build:gradle:1.0.0' depends directly on:

com.android.tools.build builder
com.android.tools.lint lint
net.sf.proguard proguard-gradle
tools.base project-test-lib

As can be seen on MVNRepository. But this artifacts have their own dependencies. Is there and way to find those out without manually traversing whole dependency tree?

As a clarification, the classpath I'm talking about is defined by:

buildscript {
    repositories {}
    dependencies { .... }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Unfortunately there is no way to specify the build script configuration to the implicit dependencies task via the CLI. You'll have to explicitly define a task of type DependencyReportTask configured with your build script configuration.

task buildscriptDependencies(type: DependencyReportTask) {
    configurations = [buildscript.configurations.classpath]
}

Update:

Beginning with Gradle 2.10 you can now get information on buildscript dependencies via

gradle buildEnvironment

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...