gradle其他模块
实际开发中有用的案例:
android {
compileSdkVersion 27
defaultConfig {
}
buildTypes {
}
sourceSets {
main {
//修改so库存放位置
jniLibs.srcDirs = ['libs']
}
}
sourceSets {
main {
//让res-ad,res-player成为和res一样的资源文件夹
res.srcDirs = ['src/main/res',
'res/main/res-ad',
'res/main/res-player']
}
}
}
this.android.sourceSets{
main {
//让res-ad,res-player成为和res一样的资源文件夹
res.srcDirs = ['src/main/res',
'res/main/res-ad',
'res/main/res-player']
}
}
public interface AndroidSourceSet
public interface AndroidSourceSet {
String getName();
AndroidSourceDirectorySet getResources();
AndroidSourceSet resources(Closure configureClosure);
AndroidSourceDirectorySet getJava();
AndroidSourceSet java(Closure configureClosure);
String getCompileConfigurationName();
String getPackageConfigurationName();
String getProvidedConfigurationName();
String getApiConfigurationName();
String getCompileOnlyConfigurationName();
String getImplementationConfigurationName();
...
/**
* Returns the name of this source set.
*
* @return The name. Never returns null.
*/
@NonNull
String getName();
/**
* Returns the Java resources which are to be copied into the javaResources output directory.
*
* @return the java resources. Never returns null.
*/
@NonNull
AndroidSourceDirectorySet