亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android帶依賴樹的aar是如何生成的(推薦)

 更新時(shí)間:2018年01月29日 09:34:55   作者:三十二蟬  
這篇文章主要介紹了Android打帶依賴樹的aar的方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

引言

Android Studio默認(rèn)打出的aar只會(huì)包含本工程的源代碼,不會(huì)攜帶library依賴的源碼;但是我們常用的一些依賴庫一般都是帶依賴關(guān)系的(通過設(shè)置 transitive = true ,來透傳依賴樹)。下面講解下這種帶依賴關(guān)系的aar是怎么生成的

代碼

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'me.vigi.fat-aar'
buildscript {
  repositories {
    jcenter()
    maven {      url "http://dl.bintray.com/vigidroid/maven"
    }
  }
  dependencies {
    classpath 'me.vigi:fat-aar-plugin:0.2.8'
  }
}
dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:26.1.0'
  embed 'com.google.auto.service:auto-service:1.0-rc2'
  embed 'com.squareup:javapoet:1.7.0'
}

如上代碼,已經(jīng)有人寫了一個(gè)專門的插件,來完成這個(gè)功能;對(duì)于想要帶依賴關(guān)系的三方庫,可用 embed 的方式引入。 三方插件Github地址

總結(jié)

以上所述是小編給大家介紹的Android帶依賴樹的aar是如何生成的,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論