maven - Bundling all dependencies in .aar file -
i have sdk project referencing quit alot of dependencies in gradle. have ask sdk users add dependencies when use sdk in projects. problem is, every time add new dependency or replace current dependency new one, i'll have ask users make changes well, not practice in opinion. there way bundle dependencies in .aar. generating artifact file following code.
uploadarchives{ repositories.mavendeployer { def deploypath = file(getproperty('aar.deploypath')) repository(url: "file://${deploypath.absolutepath}") pom.project { groupid 'mypackagename' artifactid 'wingoku-io' version "0.0.6" } }
these dependencies:
dependencies { compile 'com.github.nkzawa:socket.io-client:0.5.0' compile 'com.android.support:cardview-v7:21.+' compile 'de.greenrobot:eventbus:2.4.0' }
edit:
i have added following method in uploadarchives method. size of artifact file has increased when use .aar file in app project, can't find files.
uploadarchives{ repositories.mavendeployer { def deploypath = file(getproperty('aar.deploypath')) repository(url: "file://${deploypath.absolutepath}") pom.project { groupid 'mypackagename' artifactid 'wingoku-io' version "0.0.6" } **configurations.all { transitive = true }** }
update:
i tried following code because @aar generating errors (couldn't find xx.xx.xx.aar on jcenter()). still fails, d
compile ('com.github.nkzawa:socket.io-client:0.5.0'){ transitive=true } compile ('com.android.support:cardview-v7:21.+@aar'){ transitive=true } compile ('de.greenrobot:eventbus:2.4.0'){ transitive=true }
dalvik throws following warnings classes:
dalvikvm﹕ link of class 'lio/wingoku/sdk/fetch$6;' failed
it throws exception classdefnotfound
regarding edit
configurations.all { transitive = true }
i'm not sure effect.
i think should write this:
dependencies { compile 'com.github.nkzawa:socket.io-client:0.5.0'{ transitive=true } compile 'com.android.support:cardview-v7:21.+@aar'{ transitive=true } compile 'de.greenrobot:eventbus:2.4.0'{ transitive=true } }
it
- cardview aar include in library.
- eventbus , socket.io-client jar lib include in aar
Comments
Post a Comment