-
Notifications
You must be signed in to change notification settings - Fork 20
/
mavenCentral.gradle
110 lines (98 loc) · 3.59 KB
/
mavenCentral.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
plugins {
id 'java'
id 'groovy'
id 'maven'
}
group = 'org.c02e.jpgpj'
archivesBaseName = 'jpgpj'
version = '1.3'
description = 'Java Pretty Good Privacy Jig'
repositories {
mavenCentral()
}
dependencies {
compile 'org.bouncycastle:bcpg-jdk15on:1.70'
compile 'org.slf4j:slf4j-api:1.7.32'
testCompile 'junit:junit:4.13.2'
testCompile 'org.codehaus.groovy:groovy-all:2.5.8'
testCompile 'org.slf4j:slf4j-simple:1.7.32'
testCompile 'org.spockframework:spock-core:1.3-groovy-2.5'
}
javadoc {
title = "JPGPJ $version API"
options.memberLevel = JavadocMemberLevel.PUBLIC
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment ->
deployment.artifacts.collect { artifact ->
def input = artifact.file.path
def output = "${input}.asc"
println "sign $input ..."
def cmd = [
'gpg', '--yes',
'-u', '[email protected]',
'-o', output,
'-ab', input,
]
def proc = cmd.execute()
proc.consumeProcessOutput System.out, System.err
def result = proc.waitFor()
if (result)
throw new GradleException("result $result for $cmd")
[
getClassifier: { -> artifact.classifier },
getDate: { -> artifact.date },
getExtension: { -> "${artifact.extension}.asc" as String },
getName: { -> artifact.name },
getType: { -> "${artifact.extension}.asc" as String },
getFile: { -> new File(output) },
getBuildDependencies: { -> [] },
] as PublishArtifact
}.each { deployment.addArtifact it }
}
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication userName: ossrhUsername, password: ossrhPassword
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication userName: ossrhUsername, password: ossrhPassword
}
pom.project {
name 'Java Pretty Good Privacy Jig'
description 'JPGPJ is a simple API on top of the Bouncy Castle Java OpenPGP implementation.'
url 'https://github.com/justinludwig/jpgpj'
scm {
connection 'scm:git:[email protected]:justinludwig/jpgpj.git'
developerConnection 'scm:git:[email protected]:justinludwig/jpgpj.git'
url '[email protected]:justinludwig/jpgpj.git'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id 'justinludwig'
name 'Justin Ludwig'
email '[email protected]'
}
}
}
}
}
}