1- apply plugin : ' com.jfrog.bintray'
1+ if (! rudolph_version. contains(" SNAPSHOT" )) {
2+ apply plugin : ' com.jfrog.bintray'
3+ apply plugin : ' com.github.dcendents.android-maven'
4+ version = rudolph_version
5+ group = publishedGroupId // Maven Group ID for the artifact
26
3- version = rudolph_version
7+ install {
8+ repositories. mavenInstaller {
9+ // This generates POM.xml with proper parameters
10+ pom {
11+ project {
12+ packaging ' aar'
13+ groupId publishedGroupId
14+ artifactId artifact
415
5- if (project. hasProperty(" android" )) {
6- // Android libraries
7- task sourcesJar(type : Jar ) {
8- archiveClassifier. set(' sources' )
9- from android. sourceSets. main. java. srcDirs
10- }
16+ // Add your description here
17+ name libraryName
18+ description libraryDescription
19+ url siteUrl
20+
21+ // Set your license
22+ licenses {
23+ license {
24+ name licenseName
25+ url licenseUrl
26+ }
27+ }
28+ developers {
29+ developer {
30+ id developerId
31+ name developerName
32+ email developerEmail
33+ }
34+ }
35+ scm {
36+ connection gitUrl
37+ developerConnection gitUrl
38+ url siteUrl
1139
12- task javadoc(type : Javadoc ) {
13- failOnError = false
14- source = android. sourceSets. main. java. srcDirs
15- options {
16- encoding ' utf-8'
17- charSet ' utf-8'
18- links ' http://docs.oracle.com/javase/7/docs/api/'
19- linksOffline " https://developer.android.com/reference" , " ${ android.sdkDirectory} /docs/reference"
40+ }
41+ }
42+ }
2043 }
21- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
2244 }
23- } else {
24- // Java libraries
25- task sourcesJar(type : Jar , dependsOn : classes) {
26- archiveClassifier. set(' sources' )
27- from sourceSets. main. allSource
45+
46+ if (project. hasProperty(" android" )) {
47+ // Android libraries
48+ task sourcesJar(type : Jar ) {
49+ archiveClassifier. set(' sources' )
50+ from android. sourceSets. main. java. srcDirs
51+ }
52+
53+ task javadoc(type : Javadoc ) {
54+ failOnError = false
55+ source = android. sourceSets. main. java. srcDirs
56+ options {
57+ encoding ' utf-8'
58+ charSet ' utf-8'
59+ links ' http://docs.oracle.com/javase/7/docs/api/'
60+ linksOffline " https://developer.android.com/reference" , " ${ android.sdkDirectory} /docs/reference"
61+ }
62+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
63+ }
64+ } else {
65+ // Java libraries
66+ task sourcesJar(type : Jar , dependsOn : classes) {
67+ archiveClassifier. set(' sources' )
68+ from sourceSets. main. allSource
69+ }
2870 }
29- }
3071
31- task javadocJar (type : Jar , dependsOn : javadoc) {
32- archiveClassifier. set(' javadoc' )
33- from javadoc. destinationDir
34- }
72+ task javadocJar(type : Jar , dependsOn : javadoc) {
73+ archiveClassifier. set(' javadoc' )
74+ from javadoc. destinationDir
75+ }
3576
36- artifacts {
37- archives javadocJar
38- archives sourcesJar
39- }
77+ artifacts {
78+ archives javadocJar
79+ archives sourcesJar
80+ }
4081
41- Properties properties = new Properties ()
42- properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
82+ Properties properties = new Properties ()
83+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
4384
4485// bintray
45- bintray {
46- user = properties. getProperty(' bintray.user' )
47- key = properties. getProperty(' bintray.apikey' )
48- // userOrg = properties.getProperty("bintray.org")
86+ bintray {
87+ user = properties. getProperty(' bintray.user' )
88+ key = properties. getProperty(' bintray.apikey' )
89+ // userOrg = properties.getProperty("bintray.org")
4990
50- configurations = [' archives' ]
51- override = true
91+ configurations = [' archives' ]
92+ override = true
5293
53- pkg {
54- repo = bintrayRepo
55- name = bintrayName
56- desc = libraryDescription
57- websiteUrl = siteUrl
58- vcsUrl = gitUrl
59- // userOrg = userOrg
60- licenses = [" Apache-2.0" ]
61- publish = true
62- publicDownloadNumbers = true
63- dryRun = false
64- version {
65- name = libraryVersion
94+ pkg {
95+ repo = bintrayRepo
96+ name = bintrayName
6697 desc = libraryDescription
67- released = new Date ()
68- vcsTag = libraryVersion
98+ websiteUrl = siteUrl
99+ vcsUrl = gitUrl
100+ // userOrg = userOrg
101+ licenses = [" Apache-2.0" ]
102+ publish = true
103+ publicDownloadNumbers = true
104+ dryRun = false
105+ version {
106+ name = libraryVersion
107+ desc = libraryDescription
108+ released = new Date ()
109+ vcsTag = libraryVersion
110+ }
111+ }
112+ }
113+ } else {
114+ apply plugin : ' maven'
115+ uploadArchives {
116+ try {
117+ repositories {
118+ mavenDeployer {
119+ snapshotRepository(url : uri(" ${ System.getenv('HOME')} /repository/maven-snapshots" ))
120+ pom. groupId = publishedGroupId
121+ pom. artifactId = artifact
122+ pom. version = chihiro_version
123+ }
124+ }
125+ } catch (Exception e) {
126+ e. printStackTrace()
69127 }
70128 }
71- }
129+ }
0 commit comments