blob: 764c86f349768c95280f8feeccf09775ea343030 [file] [log] [blame]
def buildDocsDir = "$buildDir/docs"
task copyDocs(type: Copy, dependsOn: rootProject.getTasksByName("dokka", true)) {
from (rootProject.getTasksByName("dokka", true).collect { "$it.project.buildDir/dokka" }) {
include "**/*.md"
include "**/package-list"
}
from "docs"
into buildDocsDir
}
task copyExampleFrontendJs(type: Copy, dependsOn: ':example-frontend-js:bundle') {
def srcBuildDir = project(':example-frontend-js').buildDir
from "$srcBuildDir/dist"
into "$buildDocsDir/example-frontend-js"
}
task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs, copyExampleFrontendJs]) {
inputs.files(fileTree(buildDocsDir))
outputs.dir("$buildDir/dist")
workingDir file(buildDocsDir)
commandLine 'bundle', 'exec', 'jekyll', 'build'
}
task clean(type: Delete) {
delete buildDir
}