Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add demo documentation generation #425

Merged
merged 1 commit into from Oct 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 27 additions & 11 deletions build.gradle
Expand Up @@ -236,31 +236,47 @@ tasks.coveralls {
}
}

task collectDocumentation(group: "documentation", description: "Copy the documentation from subprojects") {
dependsOn "aggregateJavadocs"
inputs.dir new File(project(":genie-web").buildDir, "asciidoc/html5")
inputs.dir new File(project(":genie-docs").buildDir, "asciidoc/html5")
inputs.dir new File(project(":genie-demo").buildDir, "asciidoc/html5")
outputs.dir new File(project.buildDir, "docs")

doLast {
copy {
from new File(project(":genie-web").buildDir, "asciidoc/html5")
into "${project.buildDir}/docs/rest"
}
copy {
from new File(project(":genie-docs").buildDir, "asciidoc/html5")
into "${project.buildDir}/docs/reference"
}
copy {
from new File(project(":genie-demo").buildDir, "asciidoc/html5")
into "${project.buildDir}/docs/demo"
}
}
}

githubPages {
credentials {
username = System.getenv("GH_TOKEN")
password = ""
}

commitMessage = "Documentation generated for ${version} by Travis Build ${System.env.TRAVIS_BUILD_NUMBER}"
commitMessage = "Documentation generated for ${project.version} by Travis Build ${System.env.TRAVIS_BUILD_NUMBER}"

pages {
from("${project.buildDir}/docs/javadoc") {
into "docs/${project.version}/javadoc"
}
from(new File(project(":genie-web").buildDir, "asciidoc/html5")) {
into "docs/${project.version}/rest"
}
from(new File(project(":genie-docs").buildDir, "asciidoc/html5")) {
into "docs/${project.version}/reference"
}
from "${project.buildDir}/docs/"
into "docs/${project.version}/"
}
}

prepareGhPages {
// This also depends on asciidoctor task for some subprojects but that dependency is reverse mapped in the
// pertinent subproject build file
dependsOn "aggregateJavadocs"
dependsOn tasks.collectDocumentation
}

publishGhPages {
Expand Down
12 changes: 12 additions & 0 deletions genie-demo/build.gradle
@@ -1,3 +1,15 @@
apply plugin: "org.asciidoctor.convert"

project.parent.tasks.collectDocumentation.dependsOn project.tasks.asciidoctor

// This is needed cause some things like attributes for asciidoctor don't serialize project.version properly at runtime
def genieVersion = project.version.toString()

asciidoctor {
inputs.dir new File(project.projectDir, "/src/docs/asciidoc")
attributes "revnumber": genieVersion
}

def dockerDir = new File(project.projectDir, "/src/main/docker")

task demoStart(type: Exec, group: "Demo", description: "Bring up the Genie demo containers") {
Expand Down
9 changes: 9 additions & 0 deletions genie-demo/src/docs/asciidoc/index.adoc
@@ -0,0 +1,9 @@
= Genie Demo Guide
Tom Gianos <NetflixOSS@netflix.com>
v{revnumber}, {localdate}
:description: Reference documentation for Netflix OSS Genie
:keywords: genie, netflix, documentation, big data, cloud, oss, open source software
:toc:

== Something
{project-version}
4 changes: 2 additions & 2 deletions genie-docs/build.gradle
@@ -1,11 +1,11 @@
apply plugin: "org.asciidoctor.convert"

project.parent.tasks.prepareGhPages.dependsOn project.tasks.asciidoctor
project.parent.tasks.collectDocumentation.dependsOn project.tasks.asciidoctor

// This is needed cause some things like attributes for asciidoctor don't serialize project.version properly at runtime
def genieVersion = project.version.toString()

asciidoctor {
inputs.dir new File(project.projectDir, "/src/main/asciidoc")
inputs.dir new File(project.projectDir, "/src/docs/asciidoc")
attributes "revnumber": genieVersion
}
4 changes: 2 additions & 2 deletions genie-web/build.gradle
Expand Up @@ -6,7 +6,7 @@ plugins {

apply plugin: "org.asciidoctor.convert"

project.parent.tasks.prepareGhPages.dependsOn project.tasks.asciidoctor
project.parent.tasks.collectDocumentation.dependsOn project.tasks.asciidoctor

ext {
snippetsDir = file("build/generated-snippets")
Expand Down Expand Up @@ -96,7 +96,7 @@ def genieVersion = project.version.toString()
asciidoctor {
dependsOn test
inputs.dir snippetsDir
inputs.dir new File(project.projectDir, "/src/main/asciidoc")
inputs.dir new File(project.projectDir, "/src/docs/asciidoc")
attributes "snippets": snippetsDir, "revnumber": genieVersion
}

Expand Down