forked from web-push-libs/webpush-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.gradle
More file actions
52 lines (45 loc) · 1.84 KB
/
Copy pathrelease.gradle
File metadata and controls
52 lines (45 loc) · 1.84 KB
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
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri('https://ossrh-staging-api.central.sonatype.com/service/local/'))
snapshotRepositoryUrl.set(uri('https://central.sonatype.com/repository/maven-snapshots/'))
username = project.findProperty('sonatypeUsername') ?: project.findProperty('ossrhUsername')
password = project.findProperty('sonatypePassword') ?: project.findProperty('ossrhPassword')
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.register('verifyPublicationPom') {
dependsOn 'generatePomFileForMavenJavaPublication'
doLast {
def pomFile = file("$buildDir/publications/mavenJava/pom-default.xml")
def pom = new XmlSlurper().parse(pomFile)
def scopes = [:]
pom.dependencies.dependency.each { dependency ->
scopes["${dependency.groupId.text()}:${dependency.artifactId.text()}"] = dependency.scope.text()
}
[
'com.beust:jcommander',
'org.apache.httpcomponents:httpasyncclient',
'org.asynchttpclient:async-http-client',
'org.bitbucket.b_c:jose4j'
].each { dependency ->
if (scopes[dependency] != 'compile') {
throw new GradleException("Expected ${dependency} to be published with compile scope, got '${scopes[dependency]}'")
}
}
}
}
// Keep the historical release commands stable while using the current Sonatype plugin internally.
gradle.projectsEvaluated {
tasks.named('publish') {
dependsOn 'publishToSonatype'
}
}
tasks.register('closeAndReleaseRepository') {
group = 'publishing'
description = 'Closes and releases the current Sonatype staging repository.'
dependsOn 'findSonatypeStagingRepository', 'closeAndReleaseSonatypeStagingRepository'
}