请先阅读:http://blog.saymagic.cn/2015/02/16/release-library-to-jcenter.html

最外面的build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
maven {url 'http://dl.bintray.com/tianzhijiexian/maven'}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
} allprojects {
repositories {
jcenter()
}
}

app的build.gradle

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray' // 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version
version = "1.0.0" android {
compileSdkVersion
buildToolsVersion "22.0.1"
resourcePrefix "随便填" defaultConfig {
minSdkVersion
targetSdkVersion
versionCode
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} lintOptions {
abortOnError true
}
} dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
} def siteUrl = 'https://github.com/xxx/xxx' // 项目的主页
def gitUrl = 'https://github.com/xxx/xxx.git' // Git仓库的url
group = "com.kale.xx" // Maven Group ID for the artifact,一般填你唯一的包名
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Extra xxx' //项目描述
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'kale' //填写开发者基本信息
name 'kale'
email 'xxxxx@qq.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
} tasks.withType(JavaCompile) { options.encoding = "UTF-8" } task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
} javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true // 支持author标记
version true // 支持version标记
links "http://docs.oracle.com/javase/7/docs/api"
}
} artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
name = "ExtraXXXXX" //发布到Bintray上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

local.properties

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=H\:\\Android\\sdk bintray.user = 名字
bintray.apikey = 密钥

这时你会遇到一些坑,那么就赶快看看下面的文章是如何解决javadoc中的坑吧:

http://www.devtf.cn/?p=519

http://www.jianshu.com/p/c721f9297b2f?utm_campaign=hugo&utm_medium=reader_share&utm_content=note

这里还有一个示例:https://github.com/douo/lru-image/blob/master/library/build.gradle

参考自:

http://www.cnblogs.com/qianxudetianxia/p/4322331.html

http://www.linuxidc.com/Linux/2015-02/113874.htm

http://www.jcodecraeer.com/a/anzhuokaifa/Android_Studio/2015/0227/2502.html

http://blog.saymagic.cn/2015/02/16/release-library-to-jcenter.html

上传Android代码到Jcenter(解决了字符映射的问题)的更多相关文章

  1. 上传Android代码到gerrit服务器

    1. 配置default.xml default.xml是跟Android代码配套的,可参考google Android源码下的default.xml(.repo/manifests/default. ...

  2. 2. 上传Android代码到github

    1. 建立git仓库     cd到本地项目根目录,执行git命令     git init          同时会在项目根目录下生成一个.git的隐藏文件          windows下先禁用 ...

  3. Android 上传开源项目到 jcenter 实战踩坑之路

    本文微信公众号「AndroidTraveler」首发. 背景 其实 Android 上传开源项目到 jcenter 并不是一件新鲜事,网上也有很多文章. 包括我本人在将开源项目上传到 jcenter ...

  4. git上传项目代码到github

    参考: git学习——上传项目代码到github github上传时出现error: src refspec master does not match any解决办法 git 上传本地文件到gith ...

  5. web service上传参数代码实例

    web service上传参数代码实例 这次做的项目用到webservice比较多,最开始在网上看的参考dome,发现都不行,后来发现安卓4.0以后有很大的不同,在做传参时,有些东西需要注意: 第一, ...

  6. 第二篇--上传git 代码

    准备工作: 首先,注册一个GitHub账号. 接着,新建一个仓库. 最后,下载Git 上传代码步骤: 第一步,新建一个本地文件夹作为本地仓库,进入该文件夹. 右击选择Git Bash Here ,输入 ...

  7. Thinkphp5图片上传正常,音频和视频上传失败的原因及解决

    Thinkphp5图片上传正常,音频和视频上传失败的原因及解决 一.总结 一句话总结:php中默认限制了上传文件的大小为2M,查找错误的时候百度,且根据错误提示来查找错误. 我的实际问题是: 我的表单 ...

  8. [html5+java]文件异步读取及上传核心代码

    html5+java 文件异步读取及上传关键代码段 功能: 1.多文件文件拖拽上传,file input 多文件选择 2.html5 File Api 异步FormData,blob上传,图片显示 3 ...

  9. ExtJS + fileuploadfield上传文件代码

    后台服务端接收文件的代码: /** * 后台上传文件处理Action */ @RequestMapping(value = "/uploadFile", method=Reques ...

随机推荐

  1. jsp中如何整合CKEditor+CKFinder实现文件上传

    最近笔者做了一个新闻发布平台,放弃了之前的FCKEditor编辑器,使用了CKEditor+CKFinder,虽然免费的CKFinder是Demo版本,但是功能完整,而且用户都是比较集中精神发新闻的人 ...

  2. VC文件夹大小(转)

    使用自带的类 CFileFind finder.FindNextFile();  遍历所有文件,按照修改时间顺序遍历 //参数输入 文件夹路径 //返回文件夹大小 byte DWORD GetDirS ...

  3. GNOME3任务栏、标题栏过宽问题

    Debian 7.0 默认安装的是GNOME 3.4.2桌面系统,缺省状态下,用户会发现桌面系统的桌面任务栏及标题栏宽度太大,影响美观,同时也浪费屏幕显示的有效宽度,针对这个问题我们可以通过以下方式进 ...

  4. RTX发送消息提醒实现以及注意事项

    一.RTX简介 RTX是腾讯公司推出的企业级即时通信平台.该平台定位于降低企业通信费用,增强企业内部沟通能力,改善企业与客户之间的沟通渠道,创造新兴的企业沟通文化,提高企业生产力.RTX平台的主要功能 ...

  5. DomFlags - 给 DOM 添加书签,方便调试

    DomFlags 所以一款 Chrome 浏览器扩展程序提,供了一种新的方式与浏览器开发者工具互动.DomFlags 让你可以给 DOM 元素创建快捷键,就像用于导航 DOM 树的书签.它们可以帮助您 ...

  6. HT图形组件设计之道(四)

    在<HT图形组件设计之道(二)>我们展示了HT在2D图形矢量的数据绑定功能,这种机制不仅可用于2D图形,HT的通用组件甚至3D引擎都具备这种数据绑定机制,此篇我们将构建一个3D飞机模型,展 ...

  7. GitLab安装说明

    GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. gitlab是基于Ruby on Rails的, ...

  8. [JS] JavaScript由浅入深(1) 基本特性

    1.全局变量的特性: 在函数体内直接写的变量(未用var标志)自动升级为全局变量. (function func() { i = 100; }()); alert(i); 非常不建议不写var. va ...

  9. 重构第12天 分解依赖(Break Dependencies)

    理解:“分解依赖” 是指对部分不满足我们要求的类和方法进行依赖分解,通过装饰器来达到我们需要的功能. 详解:今天我们所讲的这个重构方法对于单元测试是非常有用的.如果你要在你的代码中加入单元测试但有一部 ...

  10. ASP.NET MVC5 网站开发实践

    http://www.cnblogs.com/mzwhj/p/3538108.html