-
Notifications
You must be signed in to change notification settings - Fork 48
/
publish.gradle
93 lines (83 loc) · 2.91 KB
/
publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
apply plugin: 'maven-publish'
apply plugin: 'signing'
// Create variables with empty default values
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["sonatypeStagingProfileId"] = ''
File secretPropsFile = project.rootProject.file('local.properties')
if (secretPropsFile.exists()) {
// Read local.properties file first if it exists
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
} else {
// Use system environment variables
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
}
}
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.java
artifactId 'stream-java'
artifact sourcesJar
artifact javadocJar
pom {
name = "Stream Feeds official Java API Client"
description = "Stream Feeds Java Client for backend and android integrations"
url = 'https://github.com/getstream/stream-chat-java'
licenses {
license {
name = 'The 3-Clause BSD License'
url = 'https://opensource.org/licenses/BSD-3-Clause'
distribution = 'repo'
}
}
developers {
developer {
id = 'getstream-support'
name = 'Stream Support'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:github.com/getstream/stream-java.git'
developerConnection = 'scm:git:ssh://github.com/getstream/stream-java.git'
url = 'https://github.com/getstream/stream-java'
}
}
}
}
}
}
signing {
sign publishing.publications
}