Search code examples
androidgradleandroid-gradle-pluginjitpack

How to add my framework on gradle


I did a lot of research and I could't get one thing I have created my own framework and I want put in on gradle.

I do not want copy paste every time a lot of code from one project to another.

I want to do like this

compile 'xxxxx'

What should I do here to set this up?


Solution

  • To achieve it you have some ways:

    1. publish your library (artifact) in central maven or jcenter.
      These repo are public, it means that your artifacts will be public.

    2. use a github repo and the jitpack plugin
      These repo are public, it means that your artifacts will be public.

    3. publish the aar in a local maven repo (local o private)
      In this case the artifact can be private.

    To publish a library in Central Maven or JCenter, it is very long to explain in an answer. Hovewer you can read these posts:

    To install a private maven , you can evaluate the nexus repository.
    Check this link for more info.