Created
April 18, 2018 14:32
-
-
Save nontravis/01e685f330c4d2f11ff5e6a4e75a6e87 to your computer and use it in GitHub Desktop.
settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Add module here **/ | |
includeFlat 'TabCommon' | |
List<Module> myModuleList = new ArrayList<>() | |
myModuleList.with { | |
add(new Module(name: ":AppProjectStructure", path: ":app")) | |
add(new Module(name: ":Common", path: "../TabCommon/Common")) | |
add(new Module(name: ":CommonApplication", path: "../TabCommon/CommonApplication")) | |
add(new Module(name: ":Library1", path: "../TabCommon/Library1")) | |
add(new Module(name: ":Library2", path: "../TabCommon/Library2")) | |
} | |
myModuleList.forEach { | |
addProject(it.getName(), it.getPath()) | |
} | |
/** Method call **/ | |
void addProject(String name, String path) { | |
include name | |
if (path != null) { | |
if( path == ":app"){ | |
project(name).projectDir = new File('app') | |
}else{ | |
project(name).projectDir = new File(settingsDir, path) | |
} | |
} | |
} | |
class Module { | |
String name | |
String path | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment