Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19854

Programmatically add a dependency as non-transitive (via Java code)

$
0
0

I want to do something like

dependencies {
  compileOnly (project(":potato")) {
    transitive = false
  }
}

in Java but I can’t seem to figure out how to… I’m looking at:

project.getDependencies().add("name", potatoProject, whatDoIPutHere??)

The only available option is Closure, presumably there is a way to use this from Java code, but usually there’s a second method with an Action parameter sitting next to it? Looking around the gradle codebase hasn’t helped me much.

Can I do this programmatically?


Viewing all articles
Browse latest Browse all 19854

Trending Articles