From 701f7adcab48ddd2db3c57c06674ea2af564ab69 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 17 Jan 2017 13:50:16 +0100 Subject: [PATCH] Docs: upgrade Dokka, start building a javadoc version of the API docs alongside the Kotlin API docs. Switch to using gradle to download/invoke it. --- build.gradle | 22 ++++++++++++++++++++++ docs/generate-docsite.sh | 10 ++-------- docs/source/_templates/layout.html | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index a79412ff8c..8eaf09b7ad 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,7 @@ buildscript { ext.jopt_simple_version = '5.0.2' ext.jansi_version = '1.14' ext.hibernate_version = '5.2.6.Final' + ext.dokka_version = '0.9.13' repositories { mavenLocal() @@ -46,6 +47,7 @@ buildscript { classpath "net.corda.plugins:quasar-utils:$gradle_plugins_version" classpath "net.corda.plugins:cordformation:$gradle_plugins_version" classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0' + classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}" } } @@ -61,6 +63,7 @@ apply plugin: 'com.github.ben-manes.versions' apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'net.corda.plugins.quasar-utils' apply plugin: 'net.corda.plugins.cordformation' +apply plugin: 'org.jetbrains.dokka' // We need the following three lines even though they're inside an allprojects {} block below because otherwise // IntelliJ gets confused when importing the project and ends up erasing and recreating the .idea directory, along @@ -185,3 +188,22 @@ bintrayConfig { email = 'dev@corda.net' } } + +// API docs + +dokka { + moduleName = 'corda' + outputDirectory = 'docs/build/html/api/kotlin' + processConfigurations = ['compile'] + sourceDirs = files('core/src/main/kotlin', 'client/src/main/kotlin', 'node/src/main/kotlin', 'finance/src/main/kotlin') +} + +task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) { + moduleName = 'corda' + outputFormat = "javadoc" + outputDirectory = 'docs/build/html/api/javadoc' + processConfigurations = ['compile'] + sourceDirs = files('core/src/main/kotlin', 'client/src/main/kotlin', 'node/src/main/kotlin', 'finance/src/main/kotlin') +} + +task apidocs(dependsOn: ['dokka', 'dokkaJavadoc']) \ No newline at end of file diff --git a/docs/generate-docsite.sh b/docs/generate-docsite.sh index 7f47ce37f9..c6de1d2f02 100755 --- a/docs/generate-docsite.sh +++ b/docs/generate-docsite.sh @@ -7,12 +7,6 @@ if [ ! -e ./gradlew ]; then exit 1 fi -if [ ! -e lib/dokka.jar ]; then - echo "Downloading Dokka tool ... " - echo - curl -L -o lib/dokka.jar https://github.com/Kotlin/dokka/releases/download/0.9.8/dokka-fatjar.jar -fi - ( cd docs @@ -43,13 +37,13 @@ fi echo "Generating docsite ..." echo - make html + make clean html ) echo echo "Generating API docs ..." echo -java -jar lib/dokka.jar -output docs/build/html/api core/src/main/kotlin finance/src/main/kotlin node/src/main/kotlin client/src/main/kotlin | grep -v "No documentation for" +./gradlew apidocs echo echo "Writing robots.txt" diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index 34159bac3f..a9928b3bea 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -6,7 +6,7 @@ {% block sidebartitle %} {{ super() }}
-API reference +API reference: Kotlin/ JavaDoc
Discourse Forums