在app module build.gradle 最后添加腳本
tasks.whenTaskAdded { task ->
?? ?println("test 11 task.name:"+task.name)
? ? if (task.name.startsWith('merge') && task.name.endsWith('NativeLibs')) {
? ? ? ? task.doFirst {
? ? ? ? ? ? println("test 22")
? ? ? ? ? ? inputs.files.each { file ->
? ? ? ? ? ? ? ? println("test 33 file.path: ${file.path}")
? ? ? ? ? ? ? ? printSoPath(new File(file.path))
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
def printSoPath(File file) {
? ? if (file != null) {
? ? ? ? if (file.isDirectory()) {
? ? ? ? ? ? file.listFiles().each {
? ? ? ? ? ? ? ? printSoPath(it)
? ? ? ? ? ? }
? ? ? ? } else if (file.absolutePath.endsWith(".so")) {
? ? ? ? ? ? println "printSoPath find so file: $file.absolutePath"
? ? ? ? }
? ? }
}