美文网首页
把项目上传至github,并在gradle中使用它

把项目上传至github,并在gradle中使用它

作者: caym | 来源:发表于2017-04-20 15:11 被阅读53次

具体步骤

在github中建立你的项目

Paste_Image.png

使用sourceTree或git命令把项目clone到本地

Paste_Image.png Paste_Image.png

使用AndroidStuido新建项目,并把项目地址修改为你刚刚clone到本地的"test4github"中,并创建一个类库lib

Paste_Image.png

我们现在在类库中添加一个加法

Paste_Image.png

在工程的gradle添加

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
Paste_Image.png

在你类库lib_test的gradle添加,YourUsername是你的github账号

 apply plugin: 'com.github.dcendents.android-maven'  
 group='com.github.YourUsername'
Paste_Image.png

如果没有wrapper文件夹,gradlew wrapper ./gradlew install

这里使用sourceTree把刚创建的项目提交到github中

Paste_Image.png Paste_Image.png

刷新github后可以看出,我们刚刚新建的lib_test库已经成功提交到github上了。

发布项目

Paste_Image.png Paste_Image.png

发布成功后成功获得仓库地址。

Paste_Image.png

生成依赖库
把发布成功的仓库地址 https://jitpack.io/

Paste_Image.png

相关文章

网友评论

      本文标题:把项目上传至github,并在gradle中使用它

      本文链接:https://www.haomeiwen.com/subject/dallzttx.html