Import module (without Gradle) to my Android Gradle project

I have a project with Gradle and I want import an android module to my project. The problem is that this module has not Gradle. Is it possible import with build.gradle this module?

Thanks in advance!!

Upvotes: 0

Views: 382

Answers (1)

Reid Harrison
Reid Harrison

Reputation: 406

If you can compile your module into its own JAR then you can add it as a Gradle dependency using something like:

repositories {
  flatDir {
    dirs 'libs'
  }
}

dependencies {
  compile 'myjar:1.0@jar'
}

or

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
}

or

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

Upvotes: 1

Related Questions