android repository github
来源:互联网 发布:eia数据美国公布时间 编辑:程序博客网 时间:2024/06/04 18:39
使用github作为远程仓库repository,封装功能模块。之后,通过gradle dependency方式集成,方便调用。
1.github repository
登录github->new repository,作为maven仓库,得到远程地址,如:https://github.com/FreeLeo/AAR.git
2.安装git工具
下载地址:https://git-scm.com/downloads
选择一个文件夹,作为本地的repository,与github关联
使用【Git Bash Here】关联
git init
git add .
git clone https://github.com/FreeLeo/AAR.git
3.library
使用Android studio,建立Moudle.
build.gradle 中修改如下部分:
apply plugin: 'com.android.library'apply plugin: 'maven'
uploadArchives { repositories.mavenDeployer { def mavenRepositoryPath = file(getProperty('aar.Utils')) repository(url: "file://${mavenRepositoryPath.absolutePath}") pom.project { groupId "com.android.open.utils" artifactId "Utils" version 1.0 } }
Project Properties gradle.properties修改
aar.Utils=D:\\aar\\AAR
4.编译生成aar
使用命令:gradlew uploadArchives
若编译成功,会在配置的本地repository中生成。
5.git上传到github
将未缓存的改动添加到已缓存的活动;
提交
上传
之后到github确认是否上传成功。
6.远程依赖
6.1 复制git当前界面地址,并修改,添加到根目录build.gradle中,位置如下:
如https://github.com/FreeLeo/AAR 修改为https://raw.githubusercontent.com/FreeLeo/AAR/master
allprojects { repositories { jcenter() maven { url "https://raw.githubusercontent.com/FreeLeo/AAR/master"} }}
6.2 在需要引用的module的build.gradle dependencies中添加:
compile 'com.android.open.utils:Utils:1.0'
- android repository github
- github删除repository
- github 删除repository
- create a github repository
- GitHub删除一个repository
- 删除gitHub repository
- clone github private repository
- github remove a repository
- 【摘录】Github 删除repository
- github windows 新建repository
- github删除repository
- Github Transfer Repository (在 Github上转移 Repository)
- 删除github repository的方法
- Github上新建一个repository
- github删除项目(repository)
- 如何删除github中的repository
- github删除自己的repository
- OpenWRT's Repository on github
- hibernate的常用方法的差异
- Ajax异步请求-GET和POST
- poj 2785
- 基础练习 杨辉三角形
- VC中cl.exe命令使用方法
- android repository github
- [Android]将应用崩溃信息汇报给开发者并重新启动应用
- 模板方法模式
- httpd 服务安装
- javascript鼠标悬浮出现二维码
- ssh从远程拷贝到本地
- Spring bean自动装配的属性值注入的个人见解
- linux 之setfacl acl权限设定
- 数据库学习--eclipse中JPA插件的安装与使用