forked from asif-finimble/web3j-AW-backPort
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
252 lines (208 loc) · 6.89 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
buildscript {
ext.spongycastleVersion = '1.54.0.0'
ext.jacksonVersion = '2.8.5'
ext.javapoetVersion = '1.7.0'
ext.jnr_unixsocketVersion = '0.15'
ext.okhttpVersion = '3.8.1'
ext.rxjavaVersion = '1.2.4'
ext.slf4jVersion = '1.7.25'
ext.bouncycastleVersion = '1.68'
// test dependencies
ext.equalsverifierVersion = '2.1.7'
ext.junitVersion = '4.11'
ext.junitBenchmarkVersion = '0.7.2'
ext.logbackVersion = '1.2.3'
ext.mockitoVersion = '1.10.19'
repositories {
mavenCentral()
}
dependencies {
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
apply plugin: 'java'
apply plugin: 'idea'
// should only be applied to the root project, see
// https://github.com/Codearte/gradle-nexus-staging-plugin#multi-project-build
apply plugin: 'io.codearte.nexus-staging'
apply plugin: 'jacoco'
description 'web3j base project'
allprojects {
sourceCompatibility = 1.6
targetCompatibility = 1.6
group 'org.web3j'
version '3.3.1-android'
apply plugin: 'java'
apply plugin: 'jacoco'
// Recent Checkstyle versions are not Java 1.6 compatible
// apply plugin: 'checkstyle'
repositories {
mavenCentral()
}
// We don't want any compiler warnings
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
compileTestJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
jacoco {
toolVersion = '0.7.7.201606060606' // See http://www.eclemma.org/jacoco/.
}
jacocoTestReport {
reports {
xml.enabled true
}
}
tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}")
}
// checkstyle {
// toolVersion = "7.7"
// configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
// }
}
subprojects {
apply plugin: 'java'
dependencies {
testCompile "junit:junit:$junitVersion",
"org.mockito:mockito-core:$mockitoVersion"
}
}
configure(subprojects.findAll {it.name != 'integration-tests'}) {
// Required for Maven Nexus repository
apply plugin: 'maven'
apply plugin: 'signing'
// Required for JFrog Artifactory repository
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
archives sourcesJar, javadocJar, testJar
}
ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier 'sources'
}
artifact testJar {
classifier 'tests'
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(
userName: ossrhUsername,
password: ossrhPassword
)
}
pom.project {
name 'web3j'
packaging 'jar'
description project.description
url 'https://web3j.io'
scm {
connection 'scm:git:https://github.com/web3j/web3j.git'
url 'https://github.com/web3j/web3j.git'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'conor10'
name 'Conor Svensson'
email '[email protected]'
}
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask('uploadArchives') } // only execute as part of this task
sign configurations.archives
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = 'org.web3j'
desc = project.description
userOrg = 'web3j'
licenses = ['Apache-2.0']
issueTrackerUrl = 'https://github.com/web3j/web3j/issues'
vcsUrl = 'https://github.com/web3j/web3j.git'
websiteUrl = 'https://web3j.io'
publicDownloadNumbers = true
}
}
task release {
//TODO run clean & closeAndPromoteRepository once
dependsOn 'build'
dependsOn 'uploadArchives'
dependsOn 'bintrayUpload'
tasks.findByName('uploadArchives').mustRunAfter 'build'
tasks.findByName('bintrayUpload').mustRunAfter 'build'
}
}
task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
xml.enabled = true
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
'org/web3j/abi/datatypes/generated/**',
'org/web3j/tuples/generated/**',
'org/web3j/ens/contracts/generated/**'
])
})
}
}