forked from fabienrenaud/java-json-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
111 lines (96 loc) · 3.69 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
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'net.ltgt.apt' version '0.9'
}
apply plugin: 'java'
group = 'com.github.fabienrenaud'
version = '3'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// CLI and misc
compile group: 'io.airlift', name: 'airline', version: '0.7'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
// org.json
compile group: 'org.json', name: 'json', version: '20090211'
// Jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.4'
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-afterburner', version: '2.8.4'
// GSON
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
// JSONP
compile group: 'javax.json', name: 'javax.json-api', version: '1.0'
compile group: 'org.glassfish', name: 'javax.json', version: '1.0.4'
// GENSON
compile group: 'com.owlike', name: 'genson', version: '1.4'
// FlexJson
compile group: 'net.sf.flexjson', name: 'flexjson', version: '3.3'
// FastJson
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.20'
// json-io
compile group: 'com.cedarsoftware', name: 'json-io', version: '4.9.0'
// boon
compile group: 'io.fastjson', name: 'boon', version: '0.34'
// johnson
compile group: 'org.apache.johnzon', name: 'johnzon-core', version: '0.9.5'
compile group: 'org.apache.johnzon', name: 'johnzon-mapper', version: '0.9.5'
// json-smart
compile group: 'net.minidev', name: 'json-smart', version: '2.2.1'
// DSL-json
compile group: 'com.dslplatform', name: 'dsl-json', version: '1.1.2'
apt group: 'com.dslplatform', name: 'dsl-json-processor', version: '1.3'
// LoganSquare
compile group: 'com.bluelinelabs', name: 'logansquare', version: '1.3.7'
apt group: 'com.bluelinelabs', name: 'logansquare-compiler', version: '1.3.7'
// json-simple
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// nanojson
compile group: 'com.grack', name: 'nanojson', version: '1.2'
// jodd
compile group: 'org.jodd', name: 'jodd-json', version: '3.8.0'
// moshi
compile group: 'com.squareup.moshi', name: 'moshi', version: '1.3.1'
// jsoniter
compile group: 'com.jsoniter', name: 'jsoniter', version: '0.9.8'
compile group: 'org.javassist', name: 'javassist', version: '3.21.0-GA'
// Test
testCompile group: 'junit', name: 'junit', version: '4.12'
// IMPORTANT: Leave JMH at the end!
// JMH
compile group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.15'
apt group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.15'
}
shadowJar {
baseName = 'benchmarks'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
task (depsize) << {
def size = 0;
def formatStr = "%,10.2f"
configurations.default.collect { it.length() / (1024 * 1024) }.each { size += it }
def out = new StringBuffer()
out << 'Total dependencies size:'.padRight(45)
out << "${String.format(formatStr, size)} MiB\n\n"
configurations
.default
.sort { -it.length() }
.each {
out << "${it.name}".padRight(45)
out << "${String.format(formatStr, (it.length() / 1024))} KiB\n"
}
println(out)
}