有些时候,想不以module方式引入一个文件夹里的项目的时候,我们如何配置gradle:
以我kotlin的实验项目为例:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "codelab.com.kotlinexperment"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
assets.srcDirs = ['assets', '../bluesea/src/main/assets']
jniLibs.srcDirs = ['libs','../bluesea/libs']
java.srcDirs = ['src/main/java', '../bluesea/src/main/java']
}
}
}
dependencies {
compile fileTree(dir: 'libs',include: ['*.jar'])
compile fileTree(dir:'../bluesea/libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}