用了这么久的android studio 很多时候都是引入别人的引用,今天自己要把自己的资源库发布了,弄了半天才成功,记录下方便自己以后查阅!
新建项目,新建module 在项目的build.gradle 中加入jitpack插件
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
...
}
在module的build.gradle中加入
apply plugin: 'com.github.dcendents.android-maven'
上传项目到github(这里就不多bb了)
发布release
jitpack发布
到此为止发布完成!
引用包
新建项目
在项目的build.gradle中加入
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
添加引用
dependencies {
implementation 'com.github.****:Library:Tag'
}