Suppose that I had 3 modules: mod1, mod2 and mod3.
In normal case, the file system hierarchy should be:
[android_root_dir]
build.gradle # list this file just to make it clear.
----mod1
----mod2
----mod3
But what I want is:
[android_root_dir]
build.gradle # list this file just to make it clear.
----modules
----mod1
----mod2
----mod3
how to do it in Android Studio 1.1.0?
PS: I find this article but it does not seem to work, or it works for earlier versions of AS, not 1.1.0: How can I move a module inside a subdirectory?
My project struct
setting.gradle file
I used repeat declarative in settings.gradle to solve. (Android Studio 3.0), I think it's AS's bug. Sometimes need restart AS.
You can do it:
In your
settings.gradle
Though
include ':modules:mod1' , ':modules:mod2', ':modules:mod3'
kind of gives you the solution, the AS annoyingly generates an empty module formodules
. To address this gotcha, please refer to thesettings.gradle
on the gradle github repo. It basically includes every subproject as a top level one and then sets its project directory to be inside the subdirectory. This trick should perfectly address your need.