-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
84 lines (75 loc) · 3.14 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
plugins {
id 'java'
id 'maven'
id 'eclipse'
id "me.champeau.gradle.jmh" version "0.5.0-rc-2"
id 'com.github.johnrengelman.shadow' version "5.1.0"
}
// Project information
ext.projectName = 'NBT'
group = 'de.piegames'
archivesBaseName = 'nbt'
version = '3.0.1'
ext.packaging = 'jar'
ext.inceptionYear = '2011'
ext.url = 'https://github.com/piegamesde/nbt/'
ext.description = 'Named Binary Tag (NBT) library for Java'
// Project repositories
repositories {
mavenLocal()
mavenCentral()
}
// Project dependencies
dependencies {
testCompile 'junit:junit:4.12'
jmh group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.12'
jmh group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.12'
}
// Filter, process, and include resources
processResources {
// Include in final JAR
from(rootProject.rootDir) {
include 'LICENSE.txt'
}
}
// Source compiler configuration
configure([compileJava, compileTestJava]) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:all'
options.compilerArgs << '-Xlint:-path'
options.deprecation = true
}
// JAR manifest configuration
jar.manifest.mainAttributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')',
'Specification-Title': projectName)
// Javadoc doclint configuration
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
jmh {
iterations = 4 // Number of measurement iterations to do.
benchmarkMode = ['thrpt'] // Benchmark mode. Available modes are: [Throughput/thrpt, AverageTime/avgt, SampleTime/sample, SingleShotTime/ss, All/all]
batchSize = 1 // Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting)
fork = 2 // How many times to forks a single benchmark. Use 0 to disable forking altogether
failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
forceGC = false // Should JMH force GC between iterations?
timeOnIteration = '5s' // Time to spend at each measurement iteration.
resultFormat = 'CSV' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
threads = 2 // Number of worker threads to run with.
timeout = '60s' // Timeout for benchmark iteration.
timeUnit = 'ms' // Output time unit. Available time units are: [m, s, ms, us, ns].
verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
warmup = '10s' // Time to spend at each warmup iteration.
warmupBatchSize = 1 // Warmup batch size: number of benchmark method calls per operation.
warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
warmupIterations = 4 // Number of warmup iterations to do.
duplicateClassesStrategy = 'fail' // Strategy to apply when encountring duplicate classes during creation of the fat jar (i.e. while executing jmhJar task)
}