forked from suppent/library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
160 lines (135 loc) · 4.33 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
plugins {
id 'java'
id 'distribution'
id 'org.hidetake.ssh' version '2.10.1'
}
group 'BFT-SMaRt'
version '2.0'
compileJava {
sourceCompatibility = 8
targetCompatibility = 8
}
repositories {
mavenCentral()
}
jar {
archivesBaseName='BFT-SMaRt'
project.version=""
}
ssh.settings {
fileTransfer = 'scp'
}
remotes {
master {
host = '<ip>'
user = '<username>'
password = '<password>'
//identity='<private key>'
}
}
task remoteDeploy(dependsOn: installDist) {
doLast {
def fileSeparator = System.getProperty("file.separator")
def src = project.buildDir.name + fileSeparator + "install" + fileSeparator + project.name
def target = '~/'
ssh.run {
session(remotes.master) {
put from: src, into: target
}
}
}
}
task localDeploy(dependsOn: installDist) {
doLast {
int nServers = 4
int nClients = 1
def fileSeparator = System.getProperty("file.separator")
def src = project.buildDir.name + fileSeparator + "install" + fileSeparator + project.name
def workingDirectory = project.buildDir.name + fileSeparator + "local" + fileSeparator
println ("Deploying project into ${workingDirectory}")
for (i in 0..<nServers) {
def target = workingDirectory + "rep${i}"
copy {
from src
into target
}
}
for (i in 0..<nClients) {
def target = workingDirectory + "cli${i}"
copy {
from src
into target
}
}
}
}
task setupIntegrationTestingEnvironment(dependsOn: installDist) {
doFirst {
int nServers = 4
int nClients = 1
def fileSeparator = System.getProperty("file.separator")
def src = project.buildDir.name + fileSeparator + "install" + fileSeparator + project.name
def workingDirectory = project.buildDir.name + fileSeparator + "integration" + fileSeparator
copy {
from src + fileSeparator + "lib"
into workingDirectory + fileSeparator + "lib"
}
copy {
from project.projectDir.absolutePath + fileSeparator + "config" + fileSeparator + "benchmark.config"
into workingDirectory
}
for (i in 0..<nServers) {
def target = workingDirectory + "rep${i}"
copy {
from src
into target
}
}
for (i in 0..<nClients) {
def target = workingDirectory + "cli${i}"
copy {
from src
into target
}
}
}
}
task recoveryIntegrationTest(type: JavaExec, dependsOn: setupIntegrationTestingEnvironment) {
def fileSeparator = System.getProperty("file.separator")
String workingDirectory = project.buildDir.absolutePath + fileSeparator + "integration" + fileSeparator
classpath = sourceSets.main.runtimeClasspath
args(workingDirectory)
mainClass = 'bftsmart.tests.recovery.RecoveryTest'
}
distributions {
main {
contents {
into('config') {
from 'config'
}
into('lib') {
from jar
from(configurations.runtimeClasspath)
}
from 'runscripts/smartrun.sh'
from 'runscripts/smartrun.cmd'
}
}
}
dependencies {
implementation fileTree('lib'){include '*.jar'}
// https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on
implementation 'org.bouncycastle:bcpkix-jdk15on:1.69'
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
implementation 'commons-codec:commons-codec:1.15'
// https://mvnrepository.com/artifact/ch.qos.logback/logback-core
implementation 'ch.qos.logback:logback-core:1.2.5'
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
implementation 'ch.qos.logback:logback-classic:1.2.5'
// https://mvnrepository.com/artifact/io.netty/netty-all
implementation 'io.netty:netty-all:4.1.67.Final'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation 'org.slf4j:slf4j-api:1.7.32'
}