Skip to content

Commit 1b9fbb2

Browse files
chore: for publishing with jreleaser
1 parent 05faf81 commit 1b9fbb2

File tree

5 files changed

+151
-138
lines changed

5 files changed

+151
-138
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
DashJ BLS for Android
1+
# DashJ BLS for Android
22

33
```bash
44
git submodule update --init --recursive
55
./gradlew build
66
```
77

8-
Publish to Maven Local
8+
### Publish to Maven Local
99
```
1010
./gradlew publishToMavenLocal
1111
```
12-
Publish to Maven Central
13-
```
12+
13+
### Publish to Maven Central
14+
15+
To deploy to the maven repository:
16+
```bash
17+
./gradlew clean
1418
./gradlew publish
19+
./gradlew jreleaserDeploy
1520
```

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ buildscript {
66
mavenLocal()
77
mavenCentral()
88
google()
9+
gradlePluginPortal() // Required for JReleaser plugin
910
}
1011
dependencies {
1112
classpath 'com.android.tools.build:gradle:8.5.1'

dashj-bls/build.gradle

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,23 @@ task comps {
104104
}
105105

106106
afterEvaluate {
107+
def projectVersion = version
108+
107109
publishing {
108110
publications {
109-
mavenJava(MavenPublication) {
110-
artifactId = 'dashj-bls-android'
111-
version "$version"
111+
release(MavenPublication) {
112+
groupId group
113+
artifactId 'dashj-bls-android'
114+
version projectVersion
112115
from components.release
113-
artifact sourcesJar
114-
artifact javadocJar
116+
115117
pom {
116118
name = 'DashJ-BLS-Android'
117119
description = 'Dash BLS Android Library'
118120
url = 'https://github.com/dashpay/dashj-android'
121+
122+
// Override packaging to jar for Maven Central compatibility
123+
packaging = 'jar'
119124

120125
licenses {
121126
license {
@@ -144,51 +149,48 @@ afterEvaluate {
144149
}
145150
}
146151
}
147-
148-
signing {
149-
required { gradle.taskGraph.hasTask("publish") }
150-
sign publishing.publications.mavenJava
151-
}
152-
}
153-
154-
jreleaser {
155-
def projectVersion = version
156-
project {
157-
name = 'dashj-bls-android'
158-
description = 'Dash BLS Android Library'
159-
website = 'https://github.com/dashpay/dashj-android'
160-
authors = ['HashEngineering']
161-
license = 'The Apache License, Version 2.0'
162-
gitRootSearch = true
163-
version = projectVersion
164-
}
152+
jreleaser {
153+
project {
154+
name = 'dashj-bls-android'
155+
description = 'Dash BLS Android Library'
156+
website = 'https://github.com/dashpay/dashj-android'
157+
authors = ['HashEngineering']
158+
license = 'The Apache License, Version 2.0'
159+
gitRootSearch = true
160+
version = projectVersion
161+
}
165162

166-
signing {
167-
active = 'ALWAYS'
168-
armored = true
169-
}
163+
signing {
164+
active = 'ALWAYS'
165+
armored = true
166+
}
170167

171-
deploy {
172-
maven {
173-
mavenCentral {
174-
sonatype {
175-
active = 'ALWAYS'
176-
url = 'https://central.sonatype.com/api/v1/publisher'
177-
stagingRepository("$buildDir/staging-deploy")
168+
deploy {
169+
maven {
170+
mavenCentral {
171+
sonatype {
172+
active = 'ALWAYS'
173+
url = 'https://central.sonatype.com/api/v1/publisher'
174+
stagingRepository("$buildDir/staging-deploy")
175+
}
178176
}
179-
}
180-
nexus2 {
181-
app {
182-
active = 'SNAPSHOT'
183-
url = 'https://central.sonatype.com/repository/maven-snapshots/'
184-
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
185-
applyMavenCentralRules = true
186-
snapshotSupported = true
187-
closeRepository = true
188-
releaseRepository = true
189-
stagingRepository("$buildDir/staging-deploy")
177+
nexus2 {
178+
app {
179+
active = 'SNAPSHOT'
180+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
181+
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
182+
applyMavenCentralRules = false // must be false for aar
183+
snapshotSupported = true
184+
closeRepository = true
185+
releaseRepository = true
186+
stagingRepository("$buildDir/staging-deploy")
187+
}
190188
}
191189
}
192190
}
193191
}
192+
signing {
193+
required { gradle.taskGraph.hasTask("publish") }
194+
sign publishing.publications.release
195+
}
194196
}

dashj-scrypt/build.gradle

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,23 @@ task comps {
149149
}
150150

151151
afterEvaluate {
152+
def projectVersion = version
153+
152154
publishing {
153155
publications {
154-
mavenJava(MavenPublication) {
156+
release(MavenPublication) {
157+
groupId group
155158
artifactId = 'dashj-scrypt-android'
156-
version "$version"
157-
// from components.release
158-
artifact sourcesJar
159-
artifact javadocJar
159+
version projectVersion
160+
from components.release
161+
160162
pom {
161163
name = 'DashJ Scrypt'
162164
description = 'DashJ Scrypt Libary for Android'
163165
url = 'https://github.com/dashpay/dashj-android'
166+
167+
// Override packaging to jar for Maven Central compatibility
168+
packaging = 'jar'
164169

165170
licenses {
166171
license {
@@ -189,51 +194,49 @@ afterEvaluate {
189194
}
190195
}
191196
}
192-
193-
signing {
194-
required { gradle.taskGraph.hasTask("publish") }
195-
sign publishing.publications.mavenJava
196-
}
197-
}
198-
199-
jreleaser {
200-
def projectVersion = version
201-
project {
202-
name = 'dashj-scrypt-android'
203-
description = 'DashJ Scrypt Libary for Android'
204-
website = 'https://github.com/dashpay/dashj-android'
205-
authors = ['HashEngineering']
206-
license = 'The Apache License, Version 2.0'
207-
gitRootSearch = true
208-
version = projectVersion
209-
}
197+
jreleaser {
198+
project {
199+
name = 'dashj-scrypt-android'
200+
description = 'DashJ Scrypt Libary for Android'
201+
website = 'https://github.com/dashpay/dashj-android'
202+
authors = ['HashEngineering']
203+
license = 'The Apache License, Version 2.0'
204+
gitRootSearch = true
205+
version = projectVersion
206+
}
210207

211-
signing {
212-
active = 'ALWAYS'
213-
armored = true
214-
}
208+
signing {
209+
active = 'ALWAYS'
210+
armored = true
211+
}
215212

216-
deploy {
217-
maven {
218-
mavenCentral {
219-
sonatype {
220-
active = 'ALWAYS'
221-
url = 'https://central.sonatype.com/api/v1/publisher'
222-
stagingRepository("$buildDir/staging-deploy")
213+
deploy {
214+
maven {
215+
mavenCentral {
216+
sonatype {
217+
active = 'ALWAYS'
218+
url = 'https://central.sonatype.com/api/v1/publisher'
219+
stagingRepository("$buildDir/staging-deploy")
220+
}
223221
}
224-
}
225-
nexus2 {
226-
app {
227-
active = 'SNAPSHOT'
228-
url = 'https://central.sonatype.com/repository/maven-snapshots/'
229-
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
230-
applyMavenCentralRules = true
231-
snapshotSupported = true
232-
closeRepository = true
233-
releaseRepository = true
234-
stagingRepository("$buildDir/staging-deploy")
222+
nexus2 {
223+
app {
224+
active = 'SNAPSHOT'
225+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
226+
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
227+
applyMavenCentralRules = false // must be false for aar
228+
snapshotSupported = true
229+
closeRepository = true
230+
releaseRepository = true
231+
stagingRepository("$buildDir/staging-deploy")
232+
}
235233
}
236234
}
237235
}
238236
}
237+
signing {
238+
required { gradle.taskGraph.hasTask("publish") }
239+
sign publishing.publications.release
240+
}
239241
}
242+

dashj-x11/build.gradle

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,23 @@ task comps {
7878
}
7979

8080
afterEvaluate {
81+
def projectVersion = version
82+
8183
publishing {
8284
publications {
83-
mavenJava(MavenPublication) {
85+
release(MavenPublication) {
86+
groupId group
8487
artifactId = 'dashj-x11-android'
85-
version "$version"
88+
version projectVersion
8689
from components.release
87-
artifact sourcesJar
88-
artifact javadocJar
90+
8991
pom {
9092
name = 'DashJ X11'
9193
description = 'DashJ X11 Library for Android'
9294
url = 'https://github.com/dashpay/dashj-android'
95+
96+
// Override packaging to jar for Maven Central compatibility
97+
packaging = 'jar'
9398

9499
licenses {
95100
license {
@@ -118,53 +123,50 @@ afterEvaluate {
118123
}
119124
}
120125
}
121-
122-
signing {
123-
required { gradle.taskGraph.hasTask("publish") }
124-
sign publishing.publications.mavenJava
125-
}
126-
}
127-
128-
jreleaser {
129-
def projectVersion = version
130-
project {
131-
name = 'dashj-x11-android'
132-
description = 'DashJ X11 Library for Android'
133-
website = 'https://github.com/dashpay/dashj-android'
134-
authors = ['HashEngineering']
135-
license = 'The Apache License, Version 2.0'
136-
gitRootSearch = true
137-
version = projectVersion
138-
}
126+
jreleaser {
127+
project {
128+
name = 'dashj-x11-android'
129+
description = 'DashJ X11 Library for Android'
130+
website = 'https://github.com/dashpay/dashj-android'
131+
authors = ['HashEngineering']
132+
license = 'The Apache License, Version 2.0'
133+
gitRootSearch = true
134+
version = projectVersion
135+
}
139136

140-
signing {
141-
active = 'ALWAYS'
142-
armored = true
143-
}
137+
signing {
138+
active = 'ALWAYS'
139+
armored = true
140+
}
144141

145-
deploy {
146-
maven {
147-
mavenCentral {
148-
sonatype {
149-
active = 'ALWAYS'
150-
url = 'https://central.sonatype.com/api/v1/publisher'
151-
stagingRepository("$buildDir/staging-deploy")
142+
deploy {
143+
maven {
144+
mavenCentral {
145+
sonatype {
146+
active = 'ALWAYS'
147+
url = 'https://central.sonatype.com/api/v1/publisher'
148+
stagingRepository("$buildDir/staging-deploy")
149+
}
152150
}
153-
}
154-
nexus2 {
155-
app {
156-
active = 'SNAPSHOT'
157-
url = 'https://central.sonatype.com/repository/maven-snapshots/'
158-
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
159-
applyMavenCentralRules = true
160-
snapshotSupported = true
161-
closeRepository = true
162-
releaseRepository = true
163-
stagingRepository("$buildDir/staging-deploy")
151+
nexus2 {
152+
app {
153+
active = 'SNAPSHOT'
154+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
155+
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
156+
applyMavenCentralRules = false // must be false for aar
157+
snapshotSupported = true
158+
closeRepository = true
159+
releaseRepository = true
160+
stagingRepository("$buildDir/staging-deploy")
161+
}
164162
}
165163
}
166164
}
167165
}
166+
signing {
167+
required { gradle.taskGraph.hasTask("publish") }
168+
sign publishing.publications.release
169+
}
168170
}
169171

170172

0 commit comments

Comments
 (0)