-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
143 lines (117 loc) · 4.5 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
plugins {
id 'java'
id 'com.diffplug.spotless' version '5.12.5'
id "com.github.node-gradle.node" version "3.0.1"
}
allprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.diffplug.spotless'
sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
}
sourceSets.main.java.srcDirs += 'build/generated/sources/main/java'
sourceSets.test.java.srcDirs += 'build/generated/sources/test/java'
spotless {
java {
target fileTree('.') {
exclude '**/*.sol'
exclude '**/.gradle/**'
exclude '**/resources'
exclude '**/build/**'
exclude '**/build/**'
include '**/*.java'
}
importOrder('net.consensys', 'java', '')
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
googleJavaFormat('1.12.0')
}
}
}
ext {
log4JVersion = '2.17.1'
okHttpVersion = '4.9.1'
jacksonVersion = '2.13.0'
rxJavaVersion = '2.2.21'
guavaVersion = '31.0.1-jre'
junitVersion = '5.7.1'
web3jVersion = '4.8.9'
}
subprojects {
test {
useJUnitPlatform()
}
if (file('src/intTest').directory) {
sourceSets {
intTest {
compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
sourceSets.intTest.java.srcDirs += 'build/generated/sources/test/java'
}
}
configurations {
intTestImplementation.extendsFrom implementation
intTestRuntimeOnly.extendsFrom runtimeOnly
}
tasks.register('intTest', Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
shouldRunAfter test
useJUnitPlatform()
}
check.dependsOn intTest
}
if (file('src/perfTest').directory) {
sourceSets {
perfTest {
compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
}
}
configurations {
perfTestImplementation.extendsFrom implementation
perfTestRuntimeOnly.extendsFrom runtimeOnly
}
tasks.register('perfTest', Test) {
description = 'Runs performance tests.'
group = 'verification'
testClassesDirs = sourceSets.perfTest.output.classesDirs
classpath = sourceSets.perfTest.runtimeClasspath
shouldRunAfter test
useJUnitPlatform()
}
check.dependsOn perfTest
}
dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4JVersion
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4JVersion
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4JVersion
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okHttpVersion
implementation group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: okHttpVersion
implementation group: 'org.web3j', name: 'core', version: web3jVersion
implementation group: 'org.web3j', name: 'abi', version: web3jVersion
implementation group: 'org.web3j', name: 'rlp', version: web3jVersion
implementation group: 'org.web3j', name: 'utils', version: web3jVersion
implementation group: 'org.web3j', name: 'crypto', version: web3jVersion
implementation group: 'org.web3j', name: 'tuples', version: web3jVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
}
}
task solFormat {
dependsOn npm_run_solFormat
}
task solCheckFormat {
dependsOn npm_run_solCheckFormat
}
task solhint {
dependsOn npm_run_solhint
}
build.dependsOn solCheckFormat
build.dependsOn solhint