Android Gradle Dependency

怎甘沉沦 提交于 2019-12-06 05:07:39

So i finally figured out a solution for this. It works for 2 level dependency mentioned above.

Create a jar file for Test Lib 2.

task clearJar(type: Delete) {
    delete 'build/outputs/loggingSDK.jar'
}

task makeJar(type: Copy) {
    from('build/intermediates/bundles/release/')
    into('build/outputs/')
    include('classes.jar')
    rename ('classes.jar', 'testlib2.jar')
}

makeJar.dependsOn(clearJar, build)

By using a the command

gradle makeJar

You would have got a testlib2.jar

Copy this into your TestLib1

Use command

gradle assemble

This would create debug and release version

Take the debug version and copy it in Test you would be able to call functions of TestLib1 which in turn calls function of TestLib2

Hope this may help someone looking for such solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!