-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbuild.gradle
More file actions
182 lines (157 loc) · 4.87 KB
/
build.gradle
File metadata and controls
182 lines (157 loc) · 4.87 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
plugins {
id 'java-library'
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
id 'signing'
id 'com.google.protobuf' version '0.8.13'
id 'idea'
id 'me.champeau.jmh' version '0.6.5'
id "com.diffplug.spotless" version "5.11.1"
}
repositories {
mavenCentral()
}
group = 'com.datadoghq'
version = '0.8.3'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceSets {
protobuf {
java {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
test {
java {
// make protobuf bindings available to tests
compileClasspath += protobuf.output
runtimeClasspath += protobuf.output
}
}
jmh {
java {
// make protobuf bindings available to jmh
compileClasspath += protobuf.output
runtimeClasspath += protobuf.output
}
}
}
configurations {
protobufCompile.extendsFrom compileClasspath
protobufRuntime.extendsFrom runtimeClasspath
}
java {
registerFeature('protobuf') {
usingSourceSet(sourceSets.protobuf)
capability('com.datadoghq', 'sketches-java-proto', version)
}
}
dependencies {
protobufImplementation 'com.google.protobuf:protobuf-java:3.13.0'
testImplementation 'com.google.protobuf:protobuf-java:3.13.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'org.openjdk.jol:jol-core:0.10'
}
protobuf {
// make it possible to build without protoc installed
protoc {
artifact = 'com.google.protobuf:protoc:3.3.0'
}
}
javadoc {
options.header = '<script type="text/javascript" id="MathJax-script" async' +
' src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">' +
'</script>'
options.addBooleanOption('-allow-script-in-comments', true)
}
jmh {
jmhVersion = '1.26'
}
jmhJar {
from sourceSets.main.output
from sourceSets.protobuf.output
}
jar {
from sourceSets.main.output
from sourceSets.protobuf.output
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
test {
useJUnitPlatform()
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
spotless {
java {
googleJavaFormat()
licenseHeader '/* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License 2.0.\n' +
' * This product includes software developed at Datadog (https://www.datadoghq.com/).\n' +
' * Copyright $YEAR Datadog, Inc.\n' +
' */\n' +
'\n'
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'DDSketch'
description = 'A Fast and Fully-Mergeable Quantile Sketch with Relative-Error Guarantees.'
url = 'https://github.com/DataDog/sketches-java'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
name = 'Charles Masson'
organization = 'Datadog'
email = 'charles.masson@datadoghq.com'
}
developer {
name = 'Jee E. Rim'
organization = 'Datadog'
email = 'jee.rim@datadoghq.com'
}
developer {
name = 'Homin K. Lee'
organization = 'Datadog'
email = 'homin@datadoghq.com'
}
}
scm {
connection = 'scm:git:git://github.com/DataDog/sketches-java.git'
developerConnection = 'scm:git:ssh://github.com:DataDog/sketches-java.git'
url = 'http://github.com/DataDog/sketches-java'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
signing {
useInMemoryPgpKeys(System.getenv("GPG_PRIVATE_KEY"), System.getenv("GPG_PASSPHRASE"))
sign publishing.publications.mavenJava
}