build.gradle 中 dependencies 的命令用法(排除某些module不編譯)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':library')
compile files('libs/dropbox-android-sdk-1.6.3.jar')
compile files('libs/json_simple-1.1.jar')
compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
compile project(':lucene-analyzers-common-4.7.2')
compile project(':lucene-core-4.7.2')
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:multidex:1.0.1'
compile('org.apache.tika:tika-parsers:1.13') {
exclude module: 'poi-ooxml' exclude module: 'poi' }
}
compile project(':library')
編譯另一個專案, library為另一個專案的根目錄名稱
compile files('libs/dropbox-android-sdk-1.6.3.jar')
編譯一個jar檔案
compile fileTree(include: ['*.jar'], dir: 'libs')
編譯一整個 libs 目錄中所有 *.jar 檔
compile('org.apache.tika:tika-parsers:1.13') {
exclude module: 'poi-ooxml' exclude module: 'poi' }
可能module如下: poi-ooxml-3.11-beta2.jar
poi-3.11.jar
(只寫出module名, 所有的版本均排除3.11, 4.1, ....)
'org.apache.tika:tika-parsers:1.13'表示這個jar是maven倉
庫的jar, 並非本地的jar
compile('org.apache.tika:tika-parsers:1.13')
{ exclude module: 'poi-ooxml' exclude module: 'poi'