Skip to content

Commit 34d6177

Browse files
committed
Exclude testing and generated glue from sources/javadoc
1 parent c426bb0 commit 34d6177

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

build.gradle.kts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,30 @@ dependencies {
3737
}
3838

3939
// collect all subproject output into a single jar
40+
fun allSources(): List<SourceDirectorySet> {
41+
return subprojects.filter { it.name != "testing" }.map { it.sourceSets.main.get().allSource }
42+
}
4043
tasks.jar {
4144
dependsOn(embed)
4245
from(embed.map { zipTree(it) })
4346
}
4447
tasks.javadoc {
4548
dependsOn(embed)
46-
setSource(subprojects.map { it.sourceSets.main.get().allSource })
49+
setSource(allSources())
50+
exclude(
51+
"datadog/instrument/glue",
52+
"datadog/instrument/utils/Glue.java",
53+
"datadog/instrument/utils/JVM.java")
54+
var javadocOptions = (options as StandardJavadocDocletOptions)
4755
if (JavaVersion.current().isJava9Compatible) {
48-
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
56+
javadocOptions.addBooleanOption("html5", true)
4957
}
58+
javadocOptions.addStringOption("-source-path",
59+
allSources().joinToString(File.pathSeparator) { it.sourceDirectories.asPath })
5060
}
5161
tasks.named<Jar>("sourcesJar") {
5262
dependsOn(embed)
53-
from(subprojects.map { it.sourceSets.main.get().allSource })
63+
from(allSources())
5464
}
5565

5666
publishing {

0 commit comments

Comments
 (0)