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

In build.gradle

we can define dependencies like:

 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'
    }
  }

      

My question is, how can I find out what types of parameters can it take compile

? I have read this document https://gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html but cannot get enough information.

I also want to know if the correct sequence (mix string and array) is:

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

      

Which works, but I'm not sure if it actually works.

+3


source to share


1 answer


'compile' is not a method but a dependency configuration and it takes a list of dependencies. Each dependency is represented by at least a group ID, an ID, and an artifact version.



You can read here: 8.3. Dependency configurations and here: 23.5. Dependency management

0


source







All Articles