-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
166 lines (145 loc) · 4.41 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
plugins {
id 'java'
id 'idea'
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'com.github.sherter.google-java-format' version '0.9'
}
println("Notice: current gradle version is " + gradle.gradleVersion)
// Additional attribute definition
ext {
// jackson version
javaSDKVersion="3.7.0"
//solcJVersion = "0.4.25.1"
//solcJVersion = "0.5.2.1"
//solcJVersion = "0.6.10.1"
solcJVersion = "0.8.11.1"
guavaVersion = "32.0.1-jre"
commonsCollections4Version = "4.4"
springVersion = '5.3.32'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
archivesBaseName = 'java-sdk-demo'
version = '3.6.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://oss.sonatype.org/service/local/staging/deploy/maven2"}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
integrationTest {
copy {
from file('src/test/resources/amop/')
into 'conf/amop'
}
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
List spring = [
"org.springframework:spring-core:$springVersion",
"org.springframework:spring-beans:$springVersion",
"org.springframework:spring-context:$springVersion",
"org.springframework:spring-tx:$springVersion",
]
def log4j_version= '2.22.1'
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"
]
googleJavaFormat {
toolVersion = '1.7'
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
exclude '**/*Test.java'
exclude '**/Test*.java'
exclude '**/Mock*.java'
}
dependencies {
implementation ('com.fasterxml.jackson.core:jackson-databind:2.14.3'){
force true
}
api ("org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:${javaSDKVersion}")
api('org.fisco-bcos.code-generator:bcos-code-generator:1.4.0') {
exclude group : "org.fisco-bcos.java-sdk"
exclude group : "org.slf4j"
exclude group : " com.fasterxml.jackson.core"
}
api ("org.fisco-bcos:solcJ:${solcJVersion}"){
exclude group : " com.fasterxml.jackson.core"
}
api ("com.google.guava:guava:${guavaVersion}")
api ("org.apache.commons:commons-collections4:${commonsCollections4Version}")
api ("me.tongfei:progressbar:0.9.2")
api spring
api logger
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
jar {
destinationDir file('dist/apps')
archiveName project.name + '-' + project.version + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
doLast {
copy {
from configurations.runtimeClasspath
into 'dist/lib'
}
copy {
from file('src/test/resources/')
into 'dist/conf'
}
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport