-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
222 lines (194 loc) · 6.33 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
import java.text.SimpleDateFormat
group = 'com.nfl.glitr'
version = System.getenv('TRAVIS_TAG') ? PROJECT_VERSION : PROJECT_VERSION + '-' + new SimpleDateFormat('yyyy-MM-dd\'T\'HH-mm-ss').format(new Date())
description = "A library that lets you use Plain Old Java Objects to describe your GraphQL schema."
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
jacoco {
toolVersion = "0.8.4"
}
//noinspection GroovyUnusedAssignment
sourceCompatibility = 1.8
//noinspection GroovyUnusedAssignment
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile("com.nfl.glitr:glitr-core:0.0.5")
// GraphQL dependencies
compile("com.graphql-java:graphql-java:13.0")
// Commons dependencies
compile("org.apache.commons:commons-lang3:3.8.1")
compile("commons-beanutils:commons-beanutils:1.9.3")
// Google dependencies
compile("com.google.code.findbugs:jsr305:3.0.0")
compile("com.google.guava:guava:27.0.1-jre")
compile("com.googlecode.gentyref:gentyref:1.2.0")
// Misc dependencies
compile("io.reactivex:rxjava:1.1.3")
compile("javax.validation:validation-api:1.1.0.Final")
compile("com.fasterxml.jackson.core:jackson-databind:2.9.9.2")
compile ("net.objecthunter:exp4j:0.4.8")
// Spock test dependencies
testCompile("junit:junit:4.12")
testCompile("cglib:cglib-nodep:3.2.12") // for spock mocking, need later version for Java 8
testCompile("org.spockframework:spock-core:1.3-groovy-2.5")
testCompile("org.codehaus.groovy:groovy-all:2.5.7")
}
task testSpock(type: Test) {
useJUnit()
}
test.dependsOn 'testSpock'
task wrapper(type: Wrapper) {
gradleVersion = '4.8.1'
}
sonarqube {
//noinspection GroovyAssignabilityCheck
properties {
//noinspection GroovyAssignabilityCheck
property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/testSpock.exec"
//noinspection GroovyAssignabilityCheck
property "sonar.coverage.exclusions", "**/*Exception.java"
property "sonar.projectKey", project.ext.app_name
property "sonar.projectName", project.ext.app_name
property "sonar.projectVersion", project.version
property "sonar.host.url", "http://sonar.dm.nfl.com/"
property "sonar.language", "java"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.scm.provider", "git"
}
}
//noinspection GroovyAssignabilityCheck
configurations.all {
// check for updates every build
// noinspection GroovyAssignabilityCheck
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
sourceSets {
//tell gradle where the resource folders (used for inclusion in the jar too)
main {
resources.srcDirs = ["src/main/resources", "generatedsources/"]
}
}
publishing {
publications {
projectPublish(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
version version
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
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 'tinnou'
name 'Antoine Boyer'
}
developer {
id 'vaant'
name 'Arash Shokoufandeh'
}
}
}
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER') ?: project.findProperty('bintray.user')
key = System.getenv('BINTRAY_KEY') ?: project.findProperty('bintray.key')
publications = ['projectPublish']
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')
}
}
}
}
// all publish tasks depend on the build task
tasks.withType(PublishToMavenRepository) {
dependsOn build
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
jar {
from "LICENSE"
manifest {
attributes(
"Specification-Title": project.name,
"Specification-Version": project.version,
"Implementation-Version": project.version,
)
}
}