0

I am about to create my first custom library. I googled, but unable to find the answer of these question.

  1. How to add my library on Gradle, so end user only need to write something like this; compile 'com.myapp.mylib:1.0.0'
  2. I have added library in an existing project like this; Now how can i export just library .aar file and not run the whole project.

enter image description here

dev90
  • 7,187
  • 15
  • 80
  • 153

1 Answers1

2

You can use Jitpack. If your library is open source it's free. Or you can publish it to your local Maven, here is example using gradle:

apply plugin: 'maven'

group = 'com.mygroup'
version = '1.0'

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "file://[your local maven path here]")
        }
    }
}

Read more here.

John
  • 1,304
  • 1
  • 9
  • 17