-
Notifications
You must be signed in to change notification settings - Fork 22
/
build-hsm.gradle
135 lines (121 loc) · 3.47 KB
/
build-hsm.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
// Apply the java-library plugin to add support for Java Library
plugins {
id 'java'
id 'idea'
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'org.ajoberstar.grgit' version '4.1.0'
}
println("Notice: current gradle version is " + gradle.gradleVersion)
// Additional attribute definition
ext {
// jackson version
javaSDKVersion="2.8.0-hsm-SNAPSHOT"
solcJVersion = "0.4.25.1"
//solcJVersion = "0.5.2.0"
//solcJVersion = "0.6.10.0"
guavaVersion = "29.0-jre"
commonsCollections4Version = "4.4"
springVersion = "4.3.27.RELEASE"
}
archivesBaseName = 'java-sdk-demo'
version = '1.0.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/service/local/staging/deploy/maven2"}
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
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 30, '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",
]
dependencies {
compile ("org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:${javaSDKVersion}")
compile ("org.fisco-bcos:solcJ:${solcJVersion}")
compile ("com.google.guava:guava:${guavaVersion}")
compile ("org.apache.commons:commons-collections4:${commonsCollections4Version}")
compile spring
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 30, '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 destinationDir
into 'dist/apps'
}
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