-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
55 lines (44 loc) · 1.35 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
group 'blockchain-benchmarking'
version 'DEVELOP'
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.log4jVersion = "2.7"
ext.lombockVersion = "1.16.6"
repositories {
mavenCentral()
}
allprojects {
apply plugin: 'java'
}
task copyJars(type: Copy) {
into project.file('benchmark-bundle')
subprojects {
from tasks.withType(Jar)
}
rename { f ->
return stripVersion(f)
}
}
static String stripVersion(String fileNameWithVersion) {
String ext = fileNameWithVersion.substring(fileNameWithVersion.lastIndexOf("."),fileNameWithVersion.length())
int end = fileNameWithVersion.lastIndexOf("-"); //assumes that: name-version.ext. Will not work with name-version-SNAPSHOT.ext
String fileNameWithoutVersion = fileNameWithVersion.substring(0, end) + ext
return fileNameWithoutVersion
}
task copyFiles(dependsOn: [copyJars])
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
subprojects {
repositories {
mavenCentral()
}
dependencies {
compile "org.apache.logging.log4j:log4j-api:$log4jVersion"
compile "org.apache.logging.log4j:log4j-core:$log4jVersion"
compile "org.projectlombok:lombok:$lombockVersion"
compile "com.fasterxml.jackson.core:jackson-databind:2.5.3"
}
}
defaultTasks 'clean', 'buildNeeded', 'copyFiles'