apetranzilla
apetranzilla

Reputation: 5959

Use Ant project as Gradle subproject

In a project I'm working on, I'd like to add another library. The problem is that I'm using Gradle and the library I want to use isn't on Maven, it's only available as a git repo with an Ant build setup. I was thinking of adding it as a submodule, and then using Gradle's Ant support to build the library and then depend on it, but I can't figure out how to have Gradle reference the build output of the library. Would I have to use compile files(...) or is there a better way?

Upvotes: 2

Views: 325

Answers (1)

Benjamin Muschko
Benjamin Muschko

Reputation: 33446

I'd build the JAR file for that library in Ant and then check it in with your project source code. You can then reference the file via the following:

dependencies {
    compile files('libs/ant-lib.jar')
}

Alternatively, I could upload the file to an in-house binary repository if you use one and then reference it via its coordinates.

Upvotes: 1

Related Questions