-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
181 lines (161 loc) · 5.3 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
import java.text.SimpleDateFormat
buildscript {
repositories {
mavenCentral()
maven {
url "http://repo.spring.io/libs-milestone"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
}
}
group = 'com.nfl.graphql'
version = System.getenv('TRAVIS_TAG') ? PROJECT_VERSION : PROJECT_VERSION + '-' + new SimpleDateFormat('yyyy-MM-dd\'T\'HH-mm-ss').format(new Date())
description = 'GraphQL based library that allows for the dynamic specification of domain objects'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'idea'
apply plugin: 'groovy'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'commons-io:commons-io:2.5'
compile 'com.google.guava:guava:23.5-jre'
compile 'com.jayway.jsonpath:json-path:2.2.0'
compile 'org.springframework:spring-context:4.3.13.RELEASE'
compile 'com.graphql-java:graphql-java:4.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6'
testCompile('org.testng:testng:6.13.1')
testCompile('org.codehaus.groovy:groovy-all:2.4.4')
testCompile('org.spockframework:spock-core:1.1-groovy-2.4')
testCompile('org.spockframework:spock-spring:1.1-groovy-2.4')
testCompile('org.springframework:spring-test:4.3.13.RELEASE')
testCompile('org.assertj:assertj-core:3.8.0')
testCompile('org.mockito:mockito-core:2.13.0')
testCompile('org.skyscreamer:jsonassert:1.5.0')
}
task wrapper(type: Wrapper) {
gradleVersion = '4.2'
}
task testJUnit(type: Test) {
}
test {
useTestNG()
dependsOn 'testJUnit'
}
publishing {
publications {
gold(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
version version
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
artifact testJar {
classifier "tests"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.name
description project.description
url PROJECT_GITHUB_REPO_URL
scm {
url PROJECT_GITHUB_REPO_URL
connection PROJECT_GITHUB_REPO_URL
developerConnection PROJECT_GITHUB_REPO_URL
}
licenses {
license {
name 'MIT'
url PROJECT_LICENSE_URL
distribution 'repo'
}
}
developers {
developer {
id 'nflearl'
name 'Earl Nolan'
}
}
}
//Bug in maven-publish plugin changes scope to runtime instead of compile
//https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile' }
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER') ?: project.findProperty('bintray.user')
key = System.getenv('BINTRAY_KEY') ?: project.findProperty('bintray.key')
publications = ['gold']
publish = true
pkg {
repo = 'maven'
name = project.name
userOrg = 'nfl'
licenses = ['MIT']
vcsUrl = PROJECT_GITHUB_REPO_URL
version {
name = project.version
desc = project.description
released = new Date()
vcsTag = 'v' + project.version
gpg {
sign = true
}
mavenCentralSync {
sync = project.property('maven.central.sync')
user = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatype.username')
password = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty('sonatype.password')
}
}
}
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output+sourceSets.test.allSource
}
artifacts {
archives sourcesJar
archives javadocJar
archives testJar
}
jar {
from "LICENSE"
manifest {
attributes(
"Specification-Title": project.name,
"Specification-Version": project.version,
"Implementation-Version": project.version,
)
}
}