三种方式
单个文件
implementation files('libs/a.jar', 'libs/b.jar')
整目录
implementation fileTree(dir: 'lib', includes: ['*.jar']) // 依赖lib目录下的所有以.jar结尾的文件
implementation fileTree(dir: 'lib', include: '*.jar') // 依赖lib目录下的所有以.jar结尾的文件
implementation fileTree(dir: 'lib', excludes: ['xxx.jar'], includes: ['*.jar']) // 依赖lib目录下的除了xxx.jar以外的所有以.jar结尾的文件
添加仓库
repositories {
flatDir {
dirs 'lib1', 'lib2'
}
}
dependencies { implementation name: 'sample-jar-0.8.7' }
标签:grable,lib,fileTree,implementation,jar,local,目录,dir
From: https://www.cnblogs.com/guanchaoguo/p/17057567.html