Android Creating your own libraries edit

Create a library available on Jitpack.io

Perform the following steps to create the library:

  1. Create a GitHub account.
  2. Create a Git repository containing your library project.
  3. Modify your library project’s build.gradle file by adding the following code:
apply plugin: 'com.github.dcendents.android-maven'

...

// Build a jar with source files.
task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    failOnError  false
    source = android.sourceSets.main.java.sourceFiles
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    classpath += configurations.compile
}

// Build a jar with javadoc.
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}

Make sure that you commit/push the above changes to GitHub.

  1. Create a release from the current code on Github.
  2. Run gradlew install on your code.
  3. Your library is now available by the following dependency:
compile 'com.github.[YourUser]:[github repository name]:[release tag]'

Table Of Contents
39 ACRA
64 Menu
106 Creating your own libraries
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close