1import org.gradle.api.artifacts.Dependency;
2
3apply plugin: 'com.android.library'
4
5android {
6    sourceSets.main {
7        manifest.srcFile 'AndroidManifest.xml'
8        java.srcDirs = ['src', 'appcompat/src']
9        res.srcDirs = ['res', 'appcompat/res']
10    }
11}
12
13dependencies {
14    compile findDependency(':support-v4', 'com.android.support:support-v4:23.3.+')
15    compile findDependency(':support-appcompat-v7', 'com.android.support:appcompat-v7:23.3.+')
16}
17
18Dependency findDependency(String projectName, String moduleName) {
19    if (findProject(projectName) != null) {
20        return dependencies.project(path: projectName)
21    }
22
23    return dependencies.create(moduleName)
24}
25