-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathbuild.gradle
60 lines (48 loc) · 2.1 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
plugins {
id 'io.deephaven.project.register'
id 'java'
}
configurations {
combinedJavadoc
}
String javaDocOverviewLocation = 'build/docs/overview.html'
// TODO(deephaven-core#2000): Ensure build work from zipped source
def gitHash
gitHash = "${-> gitHash = 'git rev-list --max-count=1 HEAD'.execute([], rootDir).text.trim()}"
def writeJavadocVersion = tasks.register 'writeJavadocVersion', {
Task t ->
t.description "Write $version to $javaDocOverviewLocation"
File versionFile = file(javaDocOverviewLocation)
t.inputs.property('version', version)
t.inputs.property('gitHash', gitHash)
t.outputs.file(versionFile)
t.doLast {
versionFile.text = '<body>Deephaven Javadoc for ' + version + '\n<!-- VCS hash: ' + gitHash + ' --></body>\n'
}
}
def allJavadoc = tasks.register 'allJavadoc', Javadoc, {
Javadoc jdoc ->
jdoc.inputs.file javaDocOverviewLocation
jdoc.options.overview = new File(javaDocOverviewLocation)
// Fail on warnings to ensure correctness for our published docs
jdoc.options.addBooleanOption('Xwerror', true)
def isForJavadocs = { Project p -> return io.deephaven.project.util.CombinedJavadoc.includeProject(p) }
jdoc.source = rootProject.subprojects
.findAll { it -> isForJavadocs(it) }
.collect { it.sourceSets.main.allJava }
jdoc.classpath = files(rootProject.subprojects
.findAll { it -> isForJavadocs(it) }
.collect { it.sourceSets.main.compileClasspath })
// https://github.com/gradle/gradle/issues/19869
def sourcepath = files()
rootProject.subprojects.findAll{ it -> isForJavadocs(it) } .each {
sourcepath = sourcepath + (FileCollection) it.sourceSets.main.allJava.getSourceDirectories()
}
options.addStringOption('sourcepath', sourcepath.getAsPath())
jdoc.destinationDir = file("${buildDir}/docs/javadoc")
jdoc.dependsOn(writeJavadocVersion)
}
apply plugin: 'io.deephaven.javadoc-conventions'
artifacts {
combinedJavadoc allJavadoc
}