2017-03-24 14:43:45 +00:00
|
|
|
apply plugin: 'org.jetbrains.dokka'
|
2017-03-28 15:12:38 +00:00
|
|
|
apply plugin: 'kotlin'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile rootProject
|
|
|
|
}
|
2017-03-24 14:43:45 +00:00
|
|
|
|
2018-01-25 15:26:13 +00:00
|
|
|
def internalPackagePrefixes(sourceDirs) {
|
|
|
|
def prefixes = []
|
|
|
|
// Kotlin allows packages to deviate from the directory structure, but let's assume they don't:
|
|
|
|
sourceDirs.collect { sourceDir ->
|
|
|
|
sourceDir.traverse(type: groovy.io.FileType.DIRECTORIES) {
|
|
|
|
if (it.name == 'internal') {
|
|
|
|
prefixes.add sourceDir.toPath().relativize(it.toPath()).toString().replace(File.separator, '.')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prefixes
|
|
|
|
}
|
|
|
|
|
2017-10-20 09:06:53 +00:00
|
|
|
ext {
|
|
|
|
// TODO: Add '../client/jfx/src/main/kotlin' and '../client/mock/src/main/kotlin' if we decide to make them into public API
|
|
|
|
dokkaSourceDirs = files('../core/src/main/kotlin', '../client/rpc/src/main/kotlin', '../finance/src/main/kotlin', '../client/jackson/src/main/kotlin',
|
|
|
|
'../testing/test-utils/src/main/kotlin', '../testing/node-driver/src/main/kotlin')
|
2018-01-25 15:26:13 +00:00
|
|
|
internalPackagePrefixes = internalPackagePrefixes(dokkaSourceDirs)
|
2017-10-20 09:06:53 +00:00
|
|
|
}
|
|
|
|
|
2017-03-24 14:43:45 +00:00
|
|
|
dokka {
|
2017-03-28 15:12:38 +00:00
|
|
|
outputDirectory = file("${rootProject.rootDir}/docs/build/html/api/kotlin")
|
2017-03-24 14:43:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
|
|
|
|
outputFormat = "javadoc"
|
2017-03-28 15:12:38 +00:00
|
|
|
outputDirectory = file("${rootProject.rootDir}/docs/build/html/api/javadoc")
|
2018-01-25 15:26:13 +00:00
|
|
|
}
|
2017-09-04 10:33:21 +00:00
|
|
|
|
2018-01-25 15:26:13 +00:00
|
|
|
[dokka, dokkaJavadoc].collect {
|
|
|
|
it.configure {
|
|
|
|
moduleName = 'corda'
|
|
|
|
processConfigurations = ['compile']
|
|
|
|
sourceDirs = dokkaSourceDirs
|
|
|
|
includes = ['packages.md']
|
|
|
|
jdkVersion = 8
|
|
|
|
externalDocumentationLink {
|
|
|
|
url = new URL("http://fasterxml.github.io/jackson-core/javadoc/2.8/")
|
|
|
|
}
|
|
|
|
externalDocumentationLink {
|
|
|
|
url = new URL("https://docs.oracle.com/javafx/2/api/")
|
|
|
|
}
|
|
|
|
externalDocumentationLink {
|
|
|
|
url = new URL("http://www.bouncycastle.org/docs/docs1.5on/")
|
|
|
|
}
|
|
|
|
internalPackagePrefixes.collect { packagePrefix ->
|
|
|
|
packageOptions {
|
|
|
|
prefix = packagePrefix
|
|
|
|
suppress = true
|
|
|
|
}
|
|
|
|
}
|
2017-09-04 10:33:21 +00:00
|
|
|
}
|
2017-03-24 14:43:45 +00:00
|
|
|
}
|
|
|
|
|
2017-03-28 13:59:16 +00:00
|
|
|
task buildDocs(dependsOn: ['apidocs', 'makeDocs'])
|
2017-03-28 15:12:38 +00:00
|
|
|
task apidocs(dependsOn: ['dokka', 'dokkaJavadoc'])
|
|
|
|
|
|
|
|
task makeDocs(type: Exec, dependsOn: ['installDocsiteRequirements']) {
|
|
|
|
// TODO: Non-msys Windows script
|
2017-04-03 15:45:55 +00:00
|
|
|
commandLine 'cmd', '/c', 'bash make-docsite.sh' // Windows
|
|
|
|
commandLine 'bash', './make-docsite.sh' // Linux
|
2017-03-28 15:12:38 +00:00
|
|
|
}
|
2017-03-24 14:43:45 +00:00
|
|
|
|
|
|
|
task installDocsiteRequirements(type: Exec) {
|
2017-03-24 16:23:12 +00:00
|
|
|
// TODO: Non-msys Windows script
|
2017-04-03 15:45:55 +00:00
|
|
|
commandLine 'cmd', '/c', 'bash install-docsite-requirements.sh' // Windows
|
|
|
|
commandLine 'bash', './install-docsite-requirements.sh' // Linux
|
2017-03-24 14:43:45 +00:00
|
|
|
}
|
|
|
|
|
2017-04-03 15:45:55 +00:00
|
|
|
apidocs.shouldRunAfter makeDocs
|