android developer
android developer

Reputation: 116030

How do I make an app use a module outside of its own folder, by linking to it (instead of copying)?

This is a very short question:

I've made a module that exist in one folder, and I'd like an app I've made use it, without the need to really copy its content.

In short I do not want duplicate folders of the module.

Is there a way in Android-Studio to make an app's project link to a module, so that changes in the module's code will immediately be reflected for the app's project ?

Upvotes: 7

Views: 1704

Answers (1)

einschnaehkeee
einschnaehkeee

Reputation: 1888

Yes you can!

Inside your settings.gradle add:

include ':myModule'

project(':myModule').projectDir = new File('../../MyOtherProject/modules/myModule')

Upvotes: 7

Related Questions