Разрешена ли эта структура?
MyProject/
| settings.gradle
+ app/
| build.gradle
+ libraries/
+ lib1/
| settings.gradle
| build.gradle
+ libraries/
+ sublib1/
| build.gradle
+ sublib2/
| build.gradle
+ lib2/
| build.gradle
Я работал с Ant, но с Gradle мой проект не смог найти sublib1 или sublib2.
Когда я запускаю Gradle, я получаю эту ошибку:
* What went wrong:
A problem occurred evaluating project ':libraries:lib1'.
> Project with path ':libraries:sublib1' could not be found in project ':libraries:lib1'.
Это settings.gradle из MyProject:
include ':libraries:lib1'
include ':libraries:lib2'
Это build.gradle из MyProject:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':libraries:lib1')
compile project(':libraries:lib2')
}
android {
compileSdkVersion 15
buildToolsVersion "17.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
Это settings.gradle от lib1:
include ':libraries:sublib1'
include ':libraries:sublib2'
Это build.gradle из lib1:
buildscript {
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':libraries:sublib1')
compile project(':libraries:sublib2')
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 15
}