Android之JitPack快速发布开源库

2016-11-16  本文已影响33人  七戈

为之于未有,治之于未乱。

JitPack
JitPack Documentation

Publish an Android library

In order to publish your Android library on JitPack you just need a working build file in your Git repository.

Android SDK is available in the build environment and ANDROID_HOME variable is already set when the build starts. Builds are run with Java 8 by default but can be configured using a jitpack.yml file.

Gradle

To enable building on JitPack you need to add the android-maven plugin.
If using Gradle 3.0 or later:

dependencies {  
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
apply plugin: 'com.github.dcendents.android-maven'  
group='com.github.YourUsername'

Remark:

Installing

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    compile 'com.github.jitpack:android-example:1.0.1'
}

Note: do not add the jitpack.io repository under build script

Demo

上一篇 下一篇

猜你喜欢

热点阅读