.so文件的导入
task copyNativeLibs(type: Copy) {
from fileTree(dir: 'libs', include: 'armeabi/*.so') into 'build/lib'
}
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
tasks.withType(Compile) {
compileTask -> compileTask.dependsOn copyNativeLibs
}
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) {
pkgTask ->pkgTask.jniFolders = [new File(buildDir, 'lib')]
}
依赖库
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
依赖包的定义
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}