forked from WeBankBlockchain/WeBASE-Front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
245 lines (219 loc) · 8.81 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
version '1.0'
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
// In this section you declare where to find the dependencies of your project
repositories {
maven {
url "http://maven.aliyun.com/nexus/content/groups/public/"
}
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://dl.bintray.com/ethereum/maven/' }
maven { url 'http://repo.typesafe.com/typesafe/maven-releases/' }
mavenLocal()
}
def spring_version="4.3.29.RELEASE"
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",
"org.springframework:spring-web:$spring_version",
"org.springframework:spring-webmvc:$spring_version",
"org.springframework:spring-jdbc:$spring_version",
// cover old version
"org.springframework:spring-aspects:$spring_version",
"org.springframework:spring-messaging:$spring_version",
"org.springframework:spring-orm:$spring_version",
"org.springframework:spring-test:$spring_version"
]
def spring_boot_version="1.5.22.RELEASE"
List spring_boot =[
"org.springframework.boot:spring-boot-starter-web:$spring_boot_version",
"org.springframework.boot:spring-boot-autoconfigure:$spring_boot_version",
"org.springframework.boot:spring-boot-configuration-processor:$spring_boot_version",
"org.springframework.boot:spring-boot-starter-data-jpa:$spring_boot_version",
"org.springframework.boot:spring-boot-starter-amqp:$spring_boot_version"
]
List swagger = [
'io.springfox:springfox-swagger2:2.8.0',
'io.springfox:springfox-swagger-ui:2.8.0'
]
def log4j_version="2.13.3"
List logger = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
"org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version",
"org.apache.logging.log4j:log4j-web:$log4j_version"
]
List jaxb = [
"javax.xml.bind:jaxb-api:2.3.0",
"com.sun.xml.bind:jaxb-impl:2.3.0",
"com.sun.xml.bind:jaxb-core:2.3.0",
"javax.activation:activation:1.1.1"
]
def jackson_version = "2.11.4"
List jackson = [
"com.fasterxml.jackson.core:jackson-annotations:$jackson_version",
"com.fasterxml.jackson.core:jackson-core:$jackson_version",
"com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
]
// cover old version
def tomcat_version = "8.5.56"
List tomcat = [
"org.apache.tomcat.embed:tomcat-embed-core:$tomcat_version",
"org.apache.tomcat.embed:tomcat-embed-el:$tomcat_version",
"org.apache.tomcat.embed:tomcat-embed-websocket:$tomcat_version",
"org.apache.tomcat:tomcat-jdbc:$tomcat_version",
"org.apache.tomcat:tomcat-juli:$tomcat_version"
]
List scaffold = [
'com.webank.webase:solscaffold:1.0.2',
'com.webank:SmartDev-Scaffold:1.0.0.1',
'com.webank:solc-gradle-plugin:1.0.1'
]
dependencies {
compile spring,spring_boot,swagger,logger,jaxb,jackson,tomcat,scaffold
compile 'org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:2.7.2'
// support guomi/ecdsa same time, support solcJ-0.5.2
compile 'org.fisco-bcos:solcJ:0.4.25-rc1'
compile 'com.h2database:h2:1.4.200'
compile 'org.fusesource:sigar:1.6.4'
annotationProcessor 'org.projectlombok:lombok:1.18.6'
compile 'org.projectlombok:lombok:1.18.6'
compile 'com.github.jsqlparser:jsqlparser:2.0'
compile 'org.apache.commons:commons-lang3:3.8.1'
compile 'org.slf4j:jcl-over-slf4j:1.7.30'
// cover low version guava
compile 'com.google.guava:guava:29.0-jre'
testCompile('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile 'junit:junit:4.12',
'org.springframework.boot:spring-boot-starter-test:1.5.9.RELEASE',
'com.github.macdao:moscow:0.1.0',
'com.squareup.okhttp3:okhttp:3.1.2'
'org.springframework.amqp:spring-rabbit-test'
}
configurations {
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
all*.exclude group: 'log4j', module: 'log4j'
all*.exclude group: 'com.github.jnr', module: 'jnr-posix'
all*.exclude group: 'com.mchange', module: '*'
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
clean {
delete 'dist'
delete 'build'
delete 'log'
}
jar {
destinationDir file('dist/apps')
archiveName project.name + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
doLast {
copy {
from file('src/main/resources/')
into 'dist/conf_template'
exclude '**/static'
}
downloadJs()
copy {
from file('gradle')
into 'dist/gradle'
}
copy {
from file('src/main/resources/static')
into 'dist/static'
}
copy {
from file('report/')
into 'dist/report'
}
copy {
from configurations.runtime
into 'dist/lib'
}
copy {
from file('.').listFiles().findAll{File f -> (f.name.endsWith('.sh') || f.name.endsWith('.env'))}
into 'dist'
}
copy {
from file('release_note.txt')
into 'dist'
}
}
}
// download js file
def downloadJs() {
String solc04Path = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.4.25.js";
String solc04gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.4.25-gm.js";
String solc05Path = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.5.2.js";
String solc05gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.5.2-gm.js";
String solc06Path = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.6.10.js";
String solc06gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.6.10-gm.js";
File solc04 = new File(solc04Path);
File solc04gm = new File(solc04gmPath);
File solc05 = new File(solc05Path);
File solc05gm = new File(solc05gmPath);
File solc06 = new File(solc06Path);
File solc06gm = new File(solc06gmPath);
if (!solc04.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.4.25.js",
"-o", solc04Path
}
}
if (!solc04gm.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.4.25-gm.js",
"-o", solc04gmPath
}
}
if (!solc05.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.5.2.js",
"-o", solc05Path
}
}
if (!solc05gm.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.5.2-gm.js",
"-o", solc05gmPath
}
}
if (!solc06.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.6.10.js",
"-o", solc06Path
}
}
if (!solc06gm.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.6.10-gm.js",
"-o", solc06gmPath
}
}
}