Implementation、API的使用

比如有个networklibrary,的build.gradle{

 
  
dependencies {

api 'com.trello:rxlifecycle:1.0'

api 'com.trello:rxlifecycle-components:1.0'

implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'

implementation 'com.squareup.retrofit2:retrofit:2.1.0'

implementation 'com.squareup.retrofit2:converter-gson:2.1.0'

api 'io.reactivex.rxjava2:rxjava:2.1.0'

api 'io.reactivex.rxjava2:rxandroid:2.0.1'

api 'com.apkfuns.logutils:library:1.4.2.2'

}

}

其中app module 某些文件引用了如下

import com.apkfuns.logutils.LogUtils;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

那么app的build.gradle就可以不用把重复的包引入了{

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//    implementation 'com.trello:rxlifecycle:1.0'
//    implementation 'com.trello:rxlifecycle-components:1.0'
//    implementation 'com.apkfuns.logutils:library:1.4.2.2'
    implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
//    implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
//    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation project(':networklibrary')
}

}



引用http://blog.csdn.net/cysion1989/article/details/73442034

引用http://blog.csdn.net/qq_26585943/article/details/73739427

你可能感兴趣的:(android)