ilan
ilan

Reputation: 4462

How to add a github library to gradle

I made a android library in github that i want to add to Gradle, that other people can add compile "my project ..." to there android build. how can i upload it to Gradle?

(I didn't find an answer for this anywhere)

EDIT: To clear my question, I want to release a library for developers.

Thanks

Upvotes: 3

Views: 1603

Answers (2)

Andrejs
Andrejs

Reputation: 27737

The easiest way to expose your library to other developers is by using the JitPack service.

The requirement is that you create a GitHub release and that you have a build file in your repository. It doesn't require that you upload your library.

Upvotes: 1

Steffen Funke
Steffen Funke

Reputation: 2468

You don't "upload a library to gradle" ;-), you make it accessibla via gradle, so you first have to compile your library and publish the generated artefacts (aar or jar files) to a central repository, like Maven Central.

There are two common Maven repositories at time of this writing:

See this guide as a direction for mavenCentral:

http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven

Since recent Android Studio versions, JCenter is the preferred default repository, so you may register there and upload your archives to it, like explained here:

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

Hope that helps.

Upvotes: 10

Related Questions