Android之发布项目至jcenter
来源:互联网 发布:网络写手赚钱吗 编辑:程序博客网 时间:2024/05/19 00:15
本文主要记录一些零碎的东西
把这篇文章中的项目发布到仓库,这个我也是头一次,查了好些,但是好多人的都说不清楚,反正作为一个新手的我看着挺乱
整理整理流程:
1 .先去注册一个账户:https://bintray.com (jcenter的代码仓库),我选的第三方登录
2. 登录后啥都不需要做,找了一个配置特别简单的类库
novoda/bintray-release : https://github.com/novoda/bintray-release
3. 找一下自己的key,点击用户名进去就可以看见,后面需要用到
4.回到Android Studio,项目的build.gradle文件(不是module的),新增
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' // upload jcenter needs classpath 'com.novoda:bintray-release:0.3.4' }}
要上传的module的build.gradle文件
apply plugin: 'com.android.library'apply plugin: 'com.novoda.bintray-release'//添加android { compileSdkVersion 24 buildToolsVersion "24.0.0" defaultConfig { minSdkVersion 15 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']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.0.0'}//添加publish { userOrg = 'cl-window'//bintray.com用户名 groupId = 'com.cl.slack'//jcenter上的路径,一般填你唯一的包名 artifactId = 'progressbar'//项目名称 publishVersion = '1.0.0'//版本号 desc = 'progressbar segment color'//描述,不重要 website = 'https://github.com/CL-window/progressBar'//网站,不重要;尽量模拟github上的地址}
点击底部的Terminal即可输入命令来上传
windows:gradlew clean build bintrayUpload -PbintrayUser=cl-window -PbintrayKey=**********...***** mac / linux :./gradlew clean build bintrayUpload -PbintrayUser=cl-window -PbintrayKey=**********...***** -PdryRun=false
user就是用户名,key就是我们刚才的让你保存的key,dryRun是一个配置参数,当为true的时候,会运行所有的环节,但是不会上传。
我的注释是使用的中文,上传是报错了,编码不一样,一个GBK,一个UTF8,没有找到好的方案解决,删注释咯
然后重新上传,成功后回到网站上,等一会儿刷新一下,会发现出来项目了,默认在maven仓库下
接下来就是添加到jCenter,点击你的项目进去,如我的 progressbar,然后一个按钮就好
随便填一下,就等那边审核通过吧,过了会发邮件提示,时间不一定,至少一个小时,通过了会给你邮件提醒
成功后
成功后在需要的项目里的build.gradle 文件里dependencies添加依赖就可以使用了
是不是看着就特别简单,主要是前人都给我们做好了
0 0
- Android之发布项目至jcenter
- Android发布项目到JCenter
- Android 发布项目到jcenter
- Android Studio发布项目到Jcenter
- Android Studio发布项目到Jcenter
- Android 发布开源项目到jcenter
- Android 发布开源项目到jcenter
- 使用Android studio发布项目到jcenter
- Android Studio发布项目到Bintray jCenter
- Android Studio发布项目到jCenter
- 将Android项目发布到Jcenter
- Android Studio 发布项目到Jcenter
- Android Studio发布项目到Jcenter
- Android快速发布项目到jcenter
- Android快速发布项目到jcenter详解
- Android进阶系列-发布项目到Jcenter
- Android快速发布项目到jcenter
- android如何发布项目到JCenter
- iOS 如何获取crash
- Oracle学习笔记一
- hdu5793 A Boring Question
- AFN原理
- android 自定义Viewpager 实现静止滑动,并去掉默认的滑动效果
- Android之发布项目至jcenter
- OPENCV视频处理,对视频帧进行复制并重新用帧复制和合成新视频
- html meta标签之http-equiv
- metalab作图
- Spring MVC ajax
- C# 枚举使用
- 全栈工程师笔记2
- POJ 1094 Sorting It All Out 拓扑排序(比较好的模板)
- Codeforces Round #365 (Div. 2) D (线段树)