1+ apply plugin : ' com.github.dcendents.android-maven'
2+ apply plugin : ' com.jfrog.bintray'
3+
4+ def siteUrl = ' https://github.com/CNCoderX/RecyclerViewHelper'
5+ def gitUrl = ' https://github.com/CNCoderX/RecyclerViewHelper.git'
6+
7+ version = " 1.0"
8+ group = " com.cncoderx.recyclerviewhelper"
9+ def libName = " RecyclerViewHelper"
10+ def libDesc = " the RecyclerView helper"
11+
12+ task sourcesJar (type : Jar ) {
13+ from android. sourceSets. main. java. srcDirs
14+ classifier = ' sources'
15+ }
16+
17+ task javadoc (type : Javadoc ) {
18+ source = android. sourceSets. main. java. srcDirs
19+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
20+ options. encoding " UTF-8"
21+ options. charSet ' UTF-8'
22+ options. author true
23+ options. version true
24+ // options.links ""
25+ failOnError false
26+ }
27+
28+ task javadocJar (type : Jar , dependsOn : javadoc) {
29+ classifier = ' javadoc'
30+ from javadoc. destinationDir
31+ }
32+
33+ task copyDoc (type : Copy ) {
34+ from " ${ buildDir} /docs/"
35+ into " docs"
36+ }
37+
38+ artifacts {
39+ archives javadocJar
40+ archives sourcesJar
41+ }
42+
43+ install {
44+ repositories. mavenInstaller {
45+ // This generates POM.xml with proper parameters
46+ pom {
47+ project {
48+ packaging ' aar'
49+ name libDesc
50+ url siteUrl
51+ licenses {
52+ license {
53+ name libDesc
54+ url siteUrl
55+ }
56+ }
57+ developers {
58+ developer {
59+ id ' cncoderx'
60+ name ' cncoderx'
61+ email ' wujie59585@foxmail.com'
62+ }
63+ }
64+ scm {
65+ connection gitUrl
66+ developerConnection gitUrl
67+ url siteUrl
68+ }
69+ }
70+ }
71+ }
72+ }
73+
74+ Properties properties = new Properties ()
75+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
76+ bintray {
77+ user = properties. getProperty(" bintray.user" )
78+ key = properties. getProperty(" bintray.apikey" )
79+ configurations = [' archives' ]
80+ pkg {
81+ repo = " maven"
82+ name = libName
83+ desc = libDesc
84+ websiteUrl = siteUrl
85+ vcsUrl = gitUrl
86+ licenses = [" Apache-2.0" ]
87+ publish = true
88+ }
89+ }
0 commit comments