forked from FISCO-BCOS/web3sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
202 lines (170 loc) · 5.71 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
plugins {
id 'java'
id 'idea'
id 'java-library'
id 'org.ajoberstar.grgit' version '4.0.1'
id 'com.github.sherter.google-java-format' version '0.8'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url 'https://dl.bintray.com/ethereum/maven/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
//configurations.all.resolutionStrategy {
// // 版本冲突时直接构建失败
// // failOnVersionConflict()
//
// // 缓存有效时间
// // cacheChangingModulesFor 0,'seconds'
//}
googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
def spring_version = "4.3.27.RELEASE"
List logger = [
'org.slf4j:slf4j-log4j12:1.7.30'
//'org.slf4j:slf4j-api:1.7.30'
]
List spring = [
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-tx:$spring_version",
]
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile spring, logger
compile 'org.apache.commons:commons-lang3:3.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
// compile 'io.netty:netty-tcnative:2.0.25.Final'
// compile 'io.netty:netty-tcnative-boringssl-static:2.0.27.Final'
// compile 'org.fisco-bcos:netty-sm-ssl-context:1.0.0-SNAPSHOT'
compile ('org.fisco-bcos:netty-sm-ssl-context:1.2.0') {
exclude module:"log4j"
}
compile 'org.ethereum:solcJ-all:0.4.25'
compile 'io.netty:netty-all:4.1.53.Final'
compile 'com.google.guava:guava:29.0-jre'
compile 'commons-configuration:commons-configuration:1.10'
compile 'org.apache.httpcomponents:httpclient:4.5.5'
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
compile 'org.apache.commons:commons-collections4:4.4'
compile 'commons-io:commons-io:2.4'
compile 'org.projectlombok:lombok:1.18.2'
compile 'com.lambdaworks:scrypt:1.4.0'
compile 'com.squareup:javapoet:1.7.0'
compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex.rxjava2:rxjava:2.2.2'
compile 'com.github.jnr:jnr-unixsocket:0.15'
compile 'info.picocli:picocli:3.6.0'
compile 'org.java-websocket:Java-WebSocket:1.5.1'
compile 'com.github.stefanbirkner:system-rules:1.18.0'
compile 'de.vandermeer:asciitable:0.3.2'
compile 'junit:junit:4.12'
compile 'org.mockito:mockito-core:2.23.0'
integrationTestCompile 'junit:junit:4.12'
integrationTestCompile 'org.mockito:mockito-core:2.23.0'
}
archivesBaseName = 'web3sdk'
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
}
// clean dist and log dir
task cleanBuildArtifacts(type: Delete) {
delete 'dist'
delete 'log'
delete 'out'
}
tasks.clean.dependsOn(tasks.cleanBuildArtifacts)
check.dependsOn integrationTest
integrationTest.mustRunAfter test
//check.dependsOn.remove(test)
//check.dependsOn.remove(integrationTest)
//check.dependsOn.remove(verifyGoogleJavaFormat)
jar {
// destinationDir file('dist/apps')
// archiveName project.name + '-' + project.version + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
manifest {
try {
def repo = grgit.open()
if (repo != null) {
def user = System.getProperty("user.name")
def date = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
def branch = repo.branch.getCurrent().getName()
def commit = repo.head().getAbbreviatedId(40)
attributes(["Built-By" : user,
"Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit
])
logger.info(" Commit : ")
logger.info(" => user: {}", user)
logger.info(" => date: {}", date)
logger.info(" => branch: {}", branch)
logger.info(" => commit: {}", commit)
}
} catch (Exception e) {
// logger.warn(' .git not exist, cannot found commit info')
}
} from sourceSets.main.output
doLast {
copy {
from destinationDir
into 'dist/apps'
}
copy {
from configurations.runtime
into 'dist/lib'
}
copy {
from file('src/test/resources/')
into 'dist/conf'
}
}
}
test {
testLogging {
showStandardStreams = true
// events "started","passed","skipped","failed"
events "passed","skipped","failed"
}
}