简书android开源代码,Android将自己写的开源代码上传到jcenter

applyplugin:'com.github.dcendents.android-maven'

applyplugin:'com.jfrog.bintray'

//项目主页

def siteUrl ='https://github.com/czl0325/ZLDotProgressbar-android'

//项目的版本控制地址

def gitUrl ='https://github.com/czl0325/ZLDotProgressbar-android.git'

//发布到组织名称名字,必须填写

group ="com.github.czl0325"

//发布到JCenter上的项目名字,必须填写

def libName ="ZLDotProgressbar"

// 版本号,下次更新是只需要更改版本号即可

version ="0.0.1"

/**  上面配置后上传至jcenter后的编译路径是这样的:compile 'cn.bluemobi.dylan:sqlitelibrary:1.0'  **/

//生成源文件

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))

options.encoding"UTF-8"

options.charSet'UTF-8'

options.authortrue

options.versiontrue

options.links"https://github.com/linglongxin24/FastDev/tree/master/mylibrary/docs/javadoc"

failOnErrorfalse

}

//文档打包成jar

task javadocJar(type: Jar,dependsOn: javadoc) {

classifier ='javadoc'

from javadoc.destinationDir

}

//拷贝javadoc文件

task copyDoc(type: Copy) {

from"${buildDir}/docs/"

into"docs"

}

//上传到jcenter所需要的源码文件

artifacts {

archivesjavadocJar

archivessourcesJar

}

// 配置maven库,生成POM.xml文件

install {

repositories.mavenInstaller {

// This generates POM.xml with proper parameters

pom {

project {

packaging'aar'

name'a dot progressbar framework'

url siteUrl

licenses {

license {

name'a dot progressbar framework'

url'https://github.com/czl0325/ZLDotProgressbar-android'

}

}

developers {

developer {

id'czl'

name'czl0325'

email'295183917@qq.com'

}

}

scm {

connection gitUrl

developerConnection gitUrl

url siteUrl

}

}

}

}

}

//上传到jcenter

Properties properties =new Properties()

properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {

user = properties.getProperty("bintray.user")//读取 local.properties 文件里面的bintray.user

key = properties.getProperty("bintray.apikey")//读取 local.properties 文件里面的bintray.apikey

configurations = ['archives']

pkg {

repo ="maven"

name ="ZLDotProgressbar"    //发布到JCenter上的项目名字,必须填写

desc ='a dot progressbar framework'    //项目描述

websiteUrl = siteUrl

vcsUrl = gitUrl

licenses = ["Apache-2.0"]

publish =true

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值