1- // Upload artifact to bintray repo
2- publish {
3- groupId = ' com.addhen'
4- artifactId = artifact
5- publishVersion = project. parent. version
6- desc = description
7- licences = [' Apache-2.0' ]
8- website = ' https://github.com/eyedol/voto-java-sdk'
9- autoPublish = true
10- bintrayUser = project. hasProperty(" bintray.user" ) ? bintray. user : " " ;
11- bintrayKey = project. hasProperty(" bintray.apikey" ) ? bintray. apikey : " " ;
1+ // Upload artifact to bintray
2+ def siteUrl = ' https://github.com/eyedol/voto-java-sdk' // Homepage URL of the library
3+ def gitUrl = ' https://eyedol@github.com/eyedol/voto-java-sdk.git' // Git repository URL
4+ def issueUrl = ' https://github.com/eyedol/voto-java-sdk/issues/'
5+ group = " com.addhen" // Maven Group ID for the artifact
6+
7+ def libVersion = project. parent. version. toString()
8+
9+ install {
10+ repositories. mavenInstaller {
11+ // This generates POM.xml with proper parameters
12+ pom {
13+ project {
14+ packaging ' jar'
15+ // Add your description here
16+ name artifact. toString()
17+ description = blob
18+ url siteUrl
19+ // Set your license
20+ licenses {
21+ license {
22+ name ' The Apache Software License, Version 2.0'
23+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
24+ }
25+ }
26+ developers {
27+ developer {
28+ id ' eyedol'
29+ name ' Henry Addo'
30+ email ' henry@addhen.org'
31+ }
32+ }
33+ scm {
34+ connection gitUrl
35+ developerConnection gitUrl
36+ url siteUrl
37+
38+ }
39+ }
40+ }
41+ }
42+ }
43+
44+ task sourcesJar (type : Jar ) {
45+ from sourceSets. main. java. srcDirs
46+ classifier = ' sources'
47+ }
48+
49+ task javadocJar (type : Jar , dependsOn : javadoc) {
50+ classifier = ' javadoc'
51+ from javadoc. destinationDir
52+ }
53+
54+ artifacts {
55+ archives javadocJar
56+ archives sourcesJar
57+ }
58+
59+ Properties properties = new Properties ()
60+ if (project. rootProject. file(' local.properties' ). exists()) {
61+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
62+ }
63+
64+ // https://github.com/bintray/gradle-bintray-plugin
65+ bintray {
66+ user = properties. getProperty(" bintray.user" , " " )
67+ key = properties. getProperty(" bintray.apikey" , " " )
68+ configurations = [' archives' ]
69+ pkg {
70+ repo = " maven"
71+ // it is the name that appears in bintray when logged
72+ name = artifact
73+ websiteUrl = siteUrl
74+ vcsUrl = gitUrl
75+ issueTrackerUrl = issueUrl
76+ licenses = [" Apache-2.0" ]
77+ labels = [' android' , ' java' , ' voto' , ' sdk' , ' api' ]
78+ publicDownloadNumbers = true
79+ publish = true
80+ desc = blob
81+ githubRepo = ' eyedol/voto-java-sdk' // Optional Github repository
82+ githubReleaseNotesFile = ' CHANGELOG.md'
83+ version {
84+ name = libVersion
85+ vcsTag = libVersion
86+ gpg {
87+ sign = true // Determines whether to GPG sign the files. The default is false
88+ passphrase = properties. getProperty(" bintray.gpg.password" , " " )
89+ // Optional. The passphrase for GPG signing'
90+ }
91+ mavenCentralSync {
92+ sync = true
93+ // Optional (true by default). Determines whether to sync the version to Maven Central.
94+ user = properties. getProperty(" bintray.oss.user" , " " ) // OSS user token
95+ password = properties. getProperty(" bintray.oss.password" , " " ) // OSS user password
96+ close = ' 1'
97+ // Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
98+ }
99+ }
100+ }
12101}
0 commit comments