forked from briandilley/jsonrpc4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
180 lines (162 loc) · 6.62 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
plugins {
id 'java'
id 'nebula.optional-base' version '3.1.0'
id 'nebula.provided-base' version '3.1.0'
id 'findbugs'
id 'pmd'
id 'jacoco'
id 'nebula.info' version '3.4.1'
id 'com.github.ben-manes.versions' version '0.13.0'
id 'osgi'
id 'maven-publish'
id 'nebula.nebula-javadoc-jar' version '2.2.2'
id 'nebula.nebula-source-jar' version '2.2.2'
id 'com.jfrog.bintray' version '1.7.3'
}
description = 'This project aims to provide the facility to easily implement JSON-RPC for the java programming language.'
version = '1.5.3'
group = 'com.github.briandilley.jsonrpc4j'
sourceCompatibility = 1.7
targetCompatibility = 1.7
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
test {
maxParallelForks 5
}
compileTestJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
repositories {
mavenCentral()
}
dependencies {
ext {
jacksonVersion = '2.8.5'
springVersion = '4.3.5.RELEASE'
springBotVersion = '1.4.3.RELEASE'
jettyVersion = '9.4.0.RC3'
slf4jVersion = '1.7.22'
}
compile 'net.iharder:base64:2.3.9'
compile "org.slf4j:slf4j-api:${slf4jVersion}"
provided 'javax.portlet:portlet-api:2.0'
provided 'javax.servlet:javax.servlet-api:3.1.0'
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
compile "org.springframework:spring-core:${springVersion}", optional
compile "org.springframework:spring-context:${springVersion}", optional
compile "org.springframework:spring-web:${springVersion}", optional
compile "org.springframework:spring-webmvc:${springVersion}", optional
compile 'commons-codec:commons-codec:1.10', optional
compile 'org.apache.httpcomponents:httpcore-nio:4.4.5', optional
testCompile 'junit:junit:4.12'
testCompile 'org.easymock:easymock:3.4'
testCompile("org.springframework.boot:spring-boot-starter-web:${springBotVersion}") {
exclude module: 'logback-classic'
}
testCompile "org.springframework.boot:spring-boot-starter-test:${springBotVersion}"
testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
exclude module: 'javax.servlet'
}
testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
exclude module: 'org.eclipse.jetty.orbit'
}
testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.7'
testRuntime 'org.apache.logging.log4j:log4j-core:2.7'
}
jar {
manifest {
instruction 'Import-Package',
'org.aopalliance.intercept;resolution:="optional"',
'org.apache.http.*;resolution:="optional"',
'org.springframework.*;resolution:="optional"',
'org.apache.commons.logging;resolution:="optional"',
'javax.portlet;resolution:="optional"',
'javax.servlet*;version=0.0.0',
'*'
}
}
jacoco {
toolVersion = '0.7.6.201602180812'
reportsDir = file("$buildDir/customJacocoReportDir")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}
publishing {
publications {
release(MavenPublication) {
from components.java
artifact tasks.javadocJar
artifact tasks.sourceJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', project.description)
def pomProperties = root.appendNode('properties')
pomProperties.appendNode('release_Manifest_Version', '1.0')
pomProperties.appendNode('release_Implementation_Title', "${project.group}:${project.name}:${project.version}")
pomProperties.appendNode('release_Implementation_Version', project.version)
pomProperties.appendNode('release_Build_Date', new Date().format('yyyy-MM-dd_HH:mm:ss'))
pomProperties.appendNode('release_Created_By', "${System.getProperty('java.runtime.version')} (${System.getProperty('java.vm.specification.vendor')})")
pomProperties.appendNode('release_Build_Java_Version', System.getProperty('java.version'))
pomProperties.appendNode('release_X_Compile_Target_JDK', project.targetCompatibility)
pomProperties.appendNode('release_X_Compile_Source_JDK', project.sourceCompatibility)
root.appendNode('url', 'https://github.com/briandilley/jsonrpc4j')
root.appendNode('scm').appendNode('url', 'https://github.com/briandilley/jsonrpc4j.git')
def devs = root.appendNode('developers')
def bernat = devs.appendNode('developer')
bernat.appendNode('id', 'gaborbernat')
bernat.appendNode('name', 'Bernát Gábor')
bernat.appendNode('email', '[email protected]')
def slipper = devs.appendNode('developer')
slipper.appendNode('id', 'mslipper')
slipper.appendNode('name', 'Matthew Slipper')
slipper.appendNode('email', '[email protected]')
def apache = root.appendNode('licenses').appendNode('license')
apache.appendNode('name', 'The MIT License')
apache.appendNode('url', 'https://opensource.org/licenses/MIT')
apache.appendNode('distribution', 'repo')
}
}
}
}
bintray {
user = project.hasProperty('user') ? project.property('user') : 'not_set'
key = project.hasProperty('key') ? project.property('key') : 'not_set'
dryRun = false
publish = true
pkg {
repo = 'maven'
name = 'com.github.briandilley.jsonrpc4j:jsonrpc4j'
desc = project.description
licenses = ['MIT']
publications = ['release']
websiteUrl = 'https://briandilley.github.io/jsonrpc4j'
issueTrackerUrl = 'https://github.com/briandilley/jsonrpc4j/issues'
vcsUrl = '[email protected]:briandilley/jsonrpc4j.git'
githubRepo = 'briandilley/jsonrpc'
githubReleaseNotesFile = 'README.md'
labels = ['json', 'rpc', 'java']
publicDownloadNumbers = true
version {
gpg {
sign = true
}
name = project.version
vcsTag = project.version
released = new Date()
}
}
}
bintrayUpload {
dependsOn "publishToMavenLocal"
}