Skip to content

Commit d6fb526

Browse files
committed
fmt
1 parent 2e3b97a commit d6fb526

File tree

2 files changed

+112
-112
lines changed

2 files changed

+112
-112
lines changed
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
tasks.register('stagingAtMavenCentralPortal') {
2-
group = 'publishing'
3-
description = 'Stages uploaded artifacts to Maven Central Portal for manual approval'
2+
group = 'publishing'
3+
description = 'Stages uploaded artifacts to Maven Central Portal for manual approval'
44

5-
doLast {
6-
def username = project.getProperty('mavenCentralUser')
7-
def password = project.getProperty('mavenCentralPassword')
8-
def deployVersion = project.findProperty('deployVersion') ?: project.version
5+
doLast {
6+
def username = project.getProperty('mavenCentralUser')
7+
def password = project.getProperty('mavenCentralPassword')
8+
def deployVersion = project.findProperty('deployVersion') ?: project.version
99

10-
if (!username || !password) {
11-
throw new GradleException("Sonatype credentials not found. Set sonatypeUser and sonatypePassword properties or environment variables.")
12-
}
10+
if (!username || !password) {
11+
throw new GradleException("Sonatype credentials not found. Set sonatypeUser and sonatypePassword properties or environment variables.")
12+
}
1313

14-
// Request API for repo key
15-
def repositoryString = providers.exec {
16-
commandLine 'curl',
17-
'-u', "${username}:${password}",
18-
'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories'
19-
}.getStandardOutput().getAsText().get()
14+
// Request API for repo key
15+
def repositoryString = providers.exec {
16+
commandLine 'curl',
17+
'-u', "${username}:${password}",
18+
'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories'
19+
}.getStandardOutput().getAsText().get()
2020

21-
def repositoryGroovy = new groovy.json.JsonSlurper().parseText(repositoryString)
22-
def key = repositoryGroovy.repositories[0].key
21+
def repositoryGroovy = new groovy.json.JsonSlurper().parseText(repositoryString)
22+
def key = repositoryGroovy.repositories[0].key
2323

24-
// Stage via curl
25-
def stageResult = providers.exec {
26-
ignoreExitValue true
27-
commandLine 'curl',
28-
'-u', "${username}:${password}",
29-
'-i', '-X', 'POST', "https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$key"
30-
}
24+
// Stage via curl
25+
def stageResult = providers.exec {
26+
ignoreExitValue true
27+
commandLine 'curl',
28+
'-u', "${username}:${password}",
29+
'-i', '-X', 'POST', "https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$key"
30+
}
3131

32-
if (stageResult.result.get().exitValue == 0) {
33-
println "✓ Staging successful!"
34-
println "Check status at: https://central.sonatype.com/publishing/deployments"
35-
} else {
36-
throw new GradleException("Staging failed")
37-
}
32+
if (stageResult.result.get().exitValue == 0) {
33+
println "✓ Staging successful!"
34+
println "Check status at: https://central.sonatype.com/publishing/deployments"
35+
} else {
36+
throw new GradleException("Staging failed")
3837
}
38+
}
3939
}
Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,107 @@
11
/* Maven publish - start */
22

33
tasks.register("sourcesJar", Jar) {
4-
archiveClassifier.set("sources")
5-
from sourceSets.main.allJava
4+
archiveClassifier.set("sources")
5+
from sourceSets.main.allJava
66
}
77

88
tasks.register("javadocJar", Jar) {
9-
dependsOn tasks.named("javadoc", Javadoc)
10-
archiveClassifier.set("javadoc")
11-
from { tasks.named("javadoc", Javadoc).get().destinationDir }
9+
dependsOn tasks.named("javadoc", Javadoc)
10+
archiveClassifier.set("javadoc")
11+
from { tasks.named("javadoc", Javadoc).get().destinationDir }
1212
}
1313

1414
if (project.hasProperty('mavenCentralUser') && project.hasProperty('mavenCentralPassword') && project.hasProperty('deployVersion')) {
1515

16-
// snapshot version differs from normal version
17-
String versionString = project.getProperty('deployVersion')
16+
// snapshot version differs from normal version
17+
String versionString = project.getProperty('deployVersion')
1818

19-
publishing {
20-
publications {
21-
create("mavenJava", MavenPublication) {
19+
publishing {
20+
publications {
21+
create("mavenJava", MavenPublication) {
2222

23-
versionMapping {
24-
// resolves dynamic versioning to current version number
25-
usage('java-api') {
26-
fromResolutionOf('runtimeClasspath')
27-
}
28-
usage('java-runtime') {
29-
fromResolutionResult()
30-
}
31-
}
32-
pom {
33-
description = 'API to create modules and add-ons for simona'
34-
name = 'simonaAPI'
35-
url = 'https:github.com/ie3-institute/simonaAPI'
36-
organization {
37-
name = 'Institute of Energy Systems, Energy Efficiency and Energy Economics (ie3)/TU Dortmund University'
38-
url = 'https:www.ie3.tu-dortmund.de/'
39-
}
40-
issueManagement {
41-
system = 'GitHub'
42-
url = 'https:github.com/ie3-institute/simonaAPI/issues'
43-
}
44-
licenses {
45-
license {
46-
name = 'BSD 3-Clause License'
47-
url = 'https:github.com/ie3-institute/simonaAPI/blob/master/LICENSE'
48-
}
49-
}
50-
developers {
51-
developer {
52-
organization = "Institute of Energy Systems, Energy Efficiency and Energy Economics (ie3)/TU Dortmund University"
53-
organizationUrl = "https:ie3.etit.tu-dortmund.de"
54-
}
55-
}
56-
scm {
57-
connection = 'scm:git:git:github.com/ie3-institute/simonaAPI.git'
58-
developerConnection = 'scm:git:ssh:github.com:ie3-institute/simonaAPI.git'
59-
url = 'https:github.com/ie3-institute/simonaAPI'
60-
}
61-
}
62-
63-
removeTestDependenciesFromPom(pom)
64-
groupId = group
65-
artifactId = 'simonaAPI'
66-
version = versionString
67-
68-
from components.java
69-
artifact sourcesJar
70-
artifact javadocJar
71-
}
23+
versionMapping {
24+
// resolves dynamic versioning to current version number
25+
usage('java-api') {
26+
fromResolutionOf('runtimeClasspath')
27+
}
28+
usage('java-runtime') {
29+
fromResolutionResult()
30+
}
7231
}
73-
repositories {
74-
maven {
75-
name = "MavenCentral"
76-
url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
77-
credentials {
78-
username = project.findProperty('mavenCentralUser')
79-
password = project.findProperty('mavenCentralPassword')
80-
}
32+
pom {
33+
description = 'API to create modules and add-ons for simona'
34+
name = 'simonaAPI'
35+
url = 'https:github.com/ie3-institute/simonaAPI'
36+
organization {
37+
name = 'Institute of Energy Systems, Energy Efficiency and Energy Economics (ie3)/TU Dortmund University'
38+
url = 'https:www.ie3.tu-dortmund.de/'
39+
}
40+
issueManagement {
41+
system = 'GitHub'
42+
url = 'https:github.com/ie3-institute/simonaAPI/issues'
43+
}
44+
licenses {
45+
license {
46+
name = 'BSD 3-Clause License'
47+
url = 'https:github.com/ie3-institute/simonaAPI/blob/master/LICENSE'
8148
}
49+
}
50+
developers {
51+
developer {
52+
organization = "Institute of Energy Systems, Energy Efficiency and Energy Economics (ie3)/TU Dortmund University"
53+
organizationUrl = "https:ie3.etit.tu-dortmund.de"
54+
}
55+
}
56+
scm {
57+
connection = 'scm:git:git:github.com/ie3-institute/simonaAPI.git'
58+
developerConnection = 'scm:git:ssh:github.com:ie3-institute/simonaAPI.git'
59+
url = 'https:github.com/ie3-institute/simonaAPI'
60+
}
8261
}
83-
signing {
84-
useInMemoryPgpKeys(
85-
findProperty('signingKey') as String,
86-
findProperty('signingPassword') as String
87-
)
88-
sign publications.mavenJava
62+
63+
removeTestDependenciesFromPom(pom)
64+
groupId = group
65+
artifactId = 'simonaAPI'
66+
version = versionString
67+
68+
from components.java
69+
artifact sourcesJar
70+
artifact javadocJar
71+
}
72+
}
73+
repositories {
74+
maven {
75+
name = "MavenCentral"
76+
url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
77+
credentials {
78+
username = project.findProperty('mavenCentralUser')
79+
password = project.findProperty('mavenCentralPassword')
8980
}
81+
}
9082
}
91-
92-
tasks.named("generatePomFileForMavenJavaPublication") {
93-
destination = layout.buildDirectory.file("generated-pom.xml").get().asFile
83+
signing {
84+
useInMemoryPgpKeys(
85+
findProperty('signingKey') as String,
86+
findProperty('signingPassword') as String
87+
)
88+
sign publications.mavenJava
9489
}
90+
}
91+
92+
tasks.named("generatePomFileForMavenJavaPublication") {
93+
destination = layout.buildDirectory.file("generated-pom.xml").get().asFile
94+
}
9595
}
9696

9797
def removeTestDependenciesFromPom(pom) {
98-
pom.withXml {
99-
def root = asNode()
100-
// eliminate test-scoped dependencies (no need in maven central POMs)
101-
root.dependencies.removeAll { dep ->
102-
dep.scope == "test"
103-
}
98+
pom.withXml {
99+
def root = asNode()
100+
// eliminate test-scoped dependencies (no need in maven central POMs)
101+
root.dependencies.removeAll { dep ->
102+
dep.scope == "test"
104103
}
104+
}
105105
}
106106

107107
/* Maven publish - end */

0 commit comments

Comments
 (0)