-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
174 lines (150 loc) · 5.14 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
/*
* Copyright 2008-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.10.1'
}
}
plugins {
id "com.github.hierynomus.license" version "0.11.0"
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.github.ben-manes.versions'
version = project.version
group = project.group
sourceCompatibility = project.javaVersion
targetCompatibility = project.javaVersion
repositories {
jcenter()
}
dependencies {
compile 'gex.commons:exceptions:0.2.0'
compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
compile 'org.springframework:spring-context:4.2.0.RC1'
compile 'org.slf4j:slf4j-api:1.7.12'
testCompile "org.codehaus.groovy:groovy-all:${project.groovyVersion}"
testCompile "org.spockframework:spock-core:${project.spockVersion}"
testCompile 'cglib:cglib-nodep:3.1'
testCompile 'org.objenesis:objenesis:2.1'
testCompile 'org.slf4j:slf4j-log4j12:1.7.12'
}
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('dd-MMM-yyyy').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('hh:mm aa').format(buildTimeAndDate)
}
def jarManifestAttributes = [
'Built-By' : System.properties['user.name'],
'Created-By': System.properties['java.version'] + ' (' + System.properties['java.vendor'] + ' ' + System.getProperty("java.vm.version") + ")",
'Build-Date': buildDate,
'Build-Time': buildTime]
jar {
manifest {
attributes(jarManifestAttributes)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
license {
header rootProject.file('HEADER_LICENSE')
strictCheck true
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', project.description)
root.appendNode('url', 'https://github.com/gextech/jaxrs-providers')
root.appendNode('inceptionYear', '2014')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/gextech/jaxrs-providers')
scm.appendNode('connection', 'scm:https://[email protected]/gextech/jaxrs-providers.git')
scm.appendNode('developerConnection', 'scm:[email protected]:gextech/jaxrs-providers.git')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'The Apache Software License, Version 2.0')
license.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def domix = developers.appendNode('developer')
domix.appendNode('id', 'domix')
domix.appendNode('name', 'Domingo Suarez Torres')
domix.appendNode('email', '[email protected]')
}
}
}
}
bintray {
user = project.hasProperty('bintrayUsername') ? bintrayUsername : ''
key = project.hasProperty('bintrayApiKey') ? bintrayApiKey : ''
publications = ['mavenJava']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'oss'
userOrg = 'gextech'
name = project.name
desc = project.description
websiteUrl = 'https://github.com/gextech/jaxrs-providers'
issueTrackerUrl = 'https://github.com/gextech/jaxrs-providers/issues'
vcsUrl = 'https://github.com/gextech/jaxrs-providers.git'
licenses = ['Apache-2.0']
labels = ['gex', 'serling', 'jax-rs']
publicDownloadNumbers = true
attributes = ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee']
//Optional version descriptor
version {
name = project.version
desc = project.description
gpg {
sign = project.hasProperty('bintrayGExGpgPassphrase')
passphrase = project.hasProperty('bintrayGExGpgPassphrase') ? bintrayGExGpgPassphrase : ''
}
mavenCentralSync {
sync = false
user = ''
password = ''
close = '1'
}
}
}
}