-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
156 lines (139 loc) · 4.41 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
import java.text.SimpleDateFormat
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 = 'A library that lets co-opt objects from other GraphQL services.'
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'commons-io:commons-io:2.5'
compile 'com.graphql-java:graphql-java:2.3.0'
compile 'org.springframework:spring-core:4.3.4.RELEASE'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6'
testCompile 'org.testng:testng:6.10'
}
test {
useTestNG()
include "**/*Test.class"
}
task wrapper(type: Wrapper) {
gradleVersion = '4.2'
}
publishing {
publications {
mediator(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 '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 = ['mediator']
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
}
artifacts {
archives sourcesJar
archives javadocJar
}
jar {
from "LICENSE"
manifest {
attributes(
"Specification-Title": project.name,
"Specification-Version": project.version,
"Implementation-Version": project.version,
)
}
}