简体   繁体   中英

Publish gradle android library on server

I'm trying to provide dependencies with Gradle to my team, both for internal uses and for third parties. This is mostly for Android and Java, but a general answer is better.

All the information I have found is more on adding Gradle dependencies to projects, but not on how to setup these dependencies to be able to be provided.

I know already how to hardlink to a gradle project with:

project(':some-lib').projectDir = new File('SomeDirectoryAddress')

But I would want to get to a point where I can add the dependency without having to hardcode its address as with other libraries provided by third parties:

compile 'com.somecompany.somelibrary:somelibrary-android:1.5.0'

Could you guide me on where to look implement this kind of service?

Is it possible to serve the projects from GitHub/Git repositories? What should I do in this case?

Just as an addition to the information already posted. I haven't used it, but I've found JitPack, a tool that makes pulling dependencies from GitHub possible.

https://jitpack.io/

there are just 2 standard servers used for host the libraries for Android such as jcenter and Maven Central

Need to follow following steps:

  1. Generate JavaDoc and source JARs
  2. Setup BinTray upload
  3. Register on BinTray.com
  4. Add details to local.properties file

Details steps are mentioned in the following links

https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/

http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM