I extracted some part of my code and resources to a new local module in Intellij IDEA 14, because the copies of them are used in several projects. I want to use the module as a support module for my gradle projects.
When the project is not based on gradle, module could be added to my project easily by adding dependency in 'project structure'. But it doesn't work in a gradle project.
How can I use the code and resources from my local module in a gradle project?
What should I do for the support module and my gradle project? I've read the user guide of gradle but still can't find a solution.
UPDATE: below is the project structure
External Gradle project
--external_project
----lib
--------src
--------build.gradle
----settings.gradle
Current Gradle project
--current_project
----app
--------src
--------build.gradle
----settings.gradle
I'm getting a error message when gradle builds,
Error:Configuration with name 'default' not found.
You can link any module by full path
1) Add module in your project settings.gradle
include ':app', ':mylib'
project(':mylib').projectDir = new File("/path-to-project/external_project/lib")
2) Add dependency in build.gradle
of app
module
dependencies {
compile project(':mylib')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With