Rapid release of Android projects to JitPack and androidjitpack
Reprinted please indicate the source:
Http://www.cnblogs.com/zhaoyanjun/p/5942616.html
From [Zhao yanjun blog] 2016/10/09
In the past, I wrote a summary article about how Android studio uses Gradle to publish an open-source Android project to JCenter. This article mainly introduces how to publish the project to jcenter. Later, I saw the blog of the great god of Hong Yang. Android quickly released the open-source project to the jcenter. This blog is easier than mine, and I am ecstatic. Now there is a way to be simpler than the previous two, which is the main character of this article. JitPack
1. About JitPack
JitPack is actually a custom Maven repository, but its process is extremely simplified. You only need to enter the Github Project address to publish the project, which greatly facilitates people like me who are too lazy to configure the environment.
2. Configure the Jitpack Plugin in Android Studio.
Add
2.1: add it under the dependencies label
Classpath 'com. github. dcendents: android-maven-gradle-plugin: 1.5'
2.2 Add a repositories label
Maven {url "https://jitpack.io "}
Note: When configuring the JitPack plug-in, you need to use the plug-in version number. When I write this blog, the latest version is 1.5. View the latest version and github repository of the plug-in
3. Configure Module build. gradle
In the build. gradle file of your Library module, add
Apply plugin: 'com. github. dcendents. android-maven'
For example
apply plugin: 'com.android.library'apply plugin: 'com.github.dcendents.android-maven'android { compileSdkVersion 24 buildToolsVersion "24.0.1" defaultConfig { minSdkVersion 14 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar'])}
Next, we will release the project to github-> click release-> click to create a new release version-> write the version number and release information.
4. Obtain the reference method
Go to the JitPack website https://jitpack.io/and log on with your github account.
Click Get it to view the reference method of the project, for example:
compile 'com.github.zyj1609wz:My:v1.0'
Note thatZyj1609wz is My github user name, My is the name of My github repository,
V1.0 is the name of the release version I created. Therefore, if you want to make the reference name of an open-source library look better, you need a good name. You need a nice github user name, a nice repository name, and a clear version number.