-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathdd-trace-ot.gradle
162 lines (140 loc) · 7.62 KB
/
dd-trace-ot.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
161
162
plugins {
id "com.github.johnrengelman.shadow"
id "me.champeau.jmh"
}
description = 'dd-trace-ot'
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/publish.gradle"
// TODO raise these when equals() and hashCode() are excluded
minimumBranchCoverage = 0.5
minimumInstructionCoverage = 0.5
excludedClassesCoverage += [
// This is mainly equals() and hashCode()
"datadog.opentracing.OTSpanContext",
// The builder is generated
"datadog.opentracing.DDTracer.DDTracerBuilder"
]
apply plugin: 'org.unbroken-dome.test-sets'
testSets {
ot31CompatabilityTest
ot33CompatabilityTest
}
dependencies {
annotationProcessor deps.autoserviceProcessor
compileOnly deps.autoserviceAnnotation
compile project(':dd-trace-api')
compile project(':dd-trace-core')
// OpenTracing
compile group: 'io.opentracing', name: 'opentracing-api', version: '0.32.0'
compile group: 'io.opentracing', name: 'opentracing-noop', version: '0.32.0'
compile group: 'io.opentracing', name: 'opentracing-util', version: '0.32.0'
compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
compile deps.slf4j
compile deps.okio
testCompile project(":dd-java-agent:testing")
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
}
[configurations.ot31CompatabilityTestCompile, configurations.ot31CompatabilityTestRuntime].each {
it.resolutionStrategy {
force group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
force group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
force group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
}
}
[configurations.ot33CompatabilityTestCompile, configurations.ot33CompatabilityTestRuntime].each {
it.resolutionStrategy {
force group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
force group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
force group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
}
}
tasks.named("test").configure {
finalizedBy "ot31CompatabilityTest", "ot33CompatabilityTest"
}
jar {
archiveClassifier = 'unbundled'
}
def bundledProjects = [':dd-trace-core', ':internal-api', ':utils:container-utils', ':utils:histograms']
shadowJar {
archiveClassifier = ''
dependencies {
bundledProjects.forEach {
include(project(it))
}
}
}
/**
* We're bundling the internal dependencies. So we need to add external transitive dependencies
* of those projects. Directly adding to the XML is the only way to prevent the shadowJar plugin
* from removing them
*/
def bundledProjectNames = bundledProjects.collect { it.substring(it.lastIndexOf(":") + 1) }
def externalDependencies = { p -> p.configurations.getByName("compile").dependencies.withType(ExternalDependency) }
tasks.withType(GenerateMavenPom).configureEach { task ->
doFirst {
task.pom.withXml { XmlProvider provider ->
Node dependencies = provider.asNode().dependencies[0]
def addedDependencies = externalDependencies(project).collect { it.name }
addedDependencies.addAll(bundledProjectNames)
bundledProjects.forEach { bundledProject ->
externalDependencies(project(bundledProject)).forEach { transitiveDependency ->
if (!addedDependencies.contains(transitiveDependency.name)) {
def dependency = dependencies.appendNode("dependency")
dependency.appendNode("groupId", transitiveDependency.group)
dependency.appendNode("artifactId", transitiveDependency.name)
dependency.appendNode("version", transitiveDependency.version)
dependency.appendNode("scope", "compile")
addedDependencies.add(transitiveDependency.name)
}
}
}
dependencies.children().removeAll { Node node -> bundledProjectNames.contains(node.artifactId[0].children()[0]) }
}
}
}
jmh {
// include = [".*URLAsResourceNameBenchmark"]
// include = ['some regular expression'] // include pattern (regular expression) for benchmarks to be executed
// exclude = ['some regular expression'] // exclude pattern (regular expression) for benchmarks to be executed
iterations = 1 // Number of measurement iterations to do.
benchmarkMode = ['thrpt', 'avgt', 'ss']
// 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 = 1 // 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?
// jvm = 'myjvm' // Custom JVM to use when forking.
// jvmArgs = ['Custom JVM args to use when forking.']
// jvmArgsAppend = ['Custom JVM args to use when forking (append these)']
// jvmArgsPrepend =[ 'Custom JVM args to use when forking (prepend these)']
// humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
// resultsFile = project.file("${project.buildDir}/reports/jmh/results.txt") // results file
// operationsPerInvocation = 10 // Operations per invocation.
// benchmarkParameters = [:] // Benchmark parameters.
// profilers = ['stack'] // Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr]
timeOnIteration = '1s' // Time to spend at each measurement iteration.
// resultFormat = 'CSV' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
// synchronizeIterations = false // Synchronize iterations?
// threads = 2 // Number of worker threads to run with.
// threadGroups = [2,3,4] //Override thread group distribution for asymmetric benchmarks.
// timeout = '1s' // Timeout for benchmark iteration.
timeUnit = 'us' // Output time unit. Available time units are: [m, s, ms, us, ns].
// verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
warmup = '2s' // Time to spend at each warmup iteration.
// warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
warmupForks = 1 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
warmupIterations = 1 // Number of warmup iterations to do.
// warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI].
// warmupBenchmarks = ['.*Warmup'] // Warmup benchmarks to include in the run in addition to already selected. JMH will not measure these benchmarks, but only use them for the warmup.
// zip64 = true // Use ZIP64 format for bigger archives
jmhVersion = '1.23' // Specifies JMH version
// includeTests = true // Allows to include test sources into generate JMH jar, i.e. use it when benchmarks depend on the test classes.
//duplicateClassesStrategy = 'warn'
// Strategy to apply when encountring duplicate classes during creation of the fat jar (i.e. while executing jmhJar task)
}