Adding external projects in the gradle build path

I have 2 projects called “ProjectA” and “ProjectB”. Say, ProjectA is part of the gradle build but ProjectB is a external project. How do I add ProjectB to the build path of ProjectA via Gradle?

when I do this via Eclipse, it always gets replaced by the Gradle build script :(…have been trying for 4 hours now with now luck. Any help will be greatly appreciated!

Typically, you’d publish B to a Maven or Ivy repository, and have A declare a dependency on it.