如何找到 `compile` 方法可以接受哪些参数?

How can I find what parameters the `compile` method can accept?

build.gradle中,我们可以定义如下依赖:

 project(':') {
    dependencies {
      compile 'joda-time:joda-time:2.1'
      compile('joda-time:joda-time:2.1')
      compile 'joda-time:joda-time:2.1', 'com.google.guava:guava:14.0.1'
    }
  }

我的问题是,如何找出 compile 可以接受的参数类型?我阅读了这份文档 https://gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html,但无法获得足够的信息。

我也想知道下面的(混合字符串和数组)是否正确:

compile 'joda-time:joda-time:2.1', ['com.google.guava:guava:14.0.1', 'commons-codec:commons-codec:1.7']

哪个有效,但我不确定它是否真的有效。

'compile' 不是方法,而是依赖配置,它接受依赖列表。每个依赖项至少由组 ID、工件 ID 和版本表示。

您可以在这里阅读更多内容:8.3. Dependency configurations and here: 23.5. Dependency management