-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
117 lines (94 loc) · 2.51 KB
/
build.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
111
112
113
114
115
116
117
plugins {
id 'java-library'
id 'idea'
id 'com.google.protobuf' version '0.8.10'
id 'maven'
id 'io.codearte.nexus-staging' version '0.21.2'
id 'signing'
}
group 'com.braintreepayments'
version '0.4.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
configurations {
deployerJars
}
dependencies {
compile 'com.graphql-java:graphql-java:17.1'
compile 'com.google.protobuf:protobuf-java:3.11.1'
compile 'com.google.code.gson:gson:2.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:3.2.0'
testCompile 'com.graphql-java-kickstart:graphql-java-tools:11.1.0'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.11.1'
}
}
def sonatypePassword = System.env['SONATYPE_PASSWORD']
nexusStaging {
packageGroup = 'com.braintreepayments'
numberOfRetries 50
delayBetweenRetriesInMillis 3000
}
signing {
required {
!version.endsWith('SNAPSHOT')
}
useGpgCmd()
sign configurations.archives
}
task javadocsJar(type: Jar) {
classifier = 'javadoc'
from sourceSets.main.java.srcDirs
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.java.srcDirs
}
artifacts {
archives javadocsJar
archives sourcesJar
}
uploadArchives {
repositories.mavenDeployer {
pom.setArtifactId 'apollo-tracing-uploader'
pom.project {
name 'apollo-tracing-uploader'
version = version
groupId 'com.braintreepayments'
description 'A GraphQL Java instrumentation for uploading tracing metrics to the Apollo Graph Manager.'
url 'https://github.com/braintree/apollo-tracing-uploader-java'
scm {
url 'scm:[email protected]:braintree/apollo-tracing-uploader-java.git'
}
developers {
developer {
id 'devs'
}
}
licenses {
license {
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
}
doFirst {
if (sonatypePassword == null) {
throw new Exception('Need to set SONATYPE_PASSWORD environment variable.')
}
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
configuration = configurations.deployerJars
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: 'braintree', password: sonatypePassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: 'braintree', password: sonatypePassword)
}
}
}