blob: 764c86f349768c95280f8feeccf09775ea343030 [file] [log] [blame]
Kirill Timofeeva5186962017-10-25 14:25:47 +03001
Roman Elizarov9fcb24f2018-03-06 11:25:09 +03002def buildDocsDir = "$buildDir/docs"
3
Roman Elizarov8fc00752017-10-27 13:35:36 +03004task copyDocs(type: Copy, dependsOn: rootProject.getTasksByName("dokka", true)) {
5 from (rootProject.getTasksByName("dokka", true).collect { "$it.project.buildDir/dokka" }) {
Kirill Timofeeva5186962017-10-25 14:25:47 +03006 include "**/*.md"
Roman Elizarovb4180742018-05-16 12:50:36 +03007 include "**/package-list"
Kirill Timofeeva5186962017-10-25 14:25:47 +03008 }
Roman Elizarov8fc00752017-10-27 13:35:36 +03009 from "docs"
Roman Elizarov9fcb24f2018-03-06 11:25:09 +030010 into buildDocsDir
Kirill Timofeeva5186962017-10-25 14:25:47 +030011}
12
Roman Elizarov88f5b9d2017-12-28 17:54:08 +030013task copyExampleFrontendJs(type: Copy, dependsOn: ':example-frontend-js:bundle') {
14 def srcBuildDir = project(':example-frontend-js').buildDir
15 from "$srcBuildDir/dist"
Roman Elizarov9fcb24f2018-03-06 11:25:09 +030016 into "$buildDocsDir/example-frontend-js"
Roman Elizarov88f5b9d2017-12-28 17:54:08 +030017}
18
19task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs, copyExampleFrontendJs]) {
Roman Elizarov9fcb24f2018-03-06 11:25:09 +030020 inputs.files(fileTree(buildDocsDir))
21 outputs.dir("$buildDir/dist")
22 workingDir file(buildDocsDir)
Roman Elizarov97943c42018-01-13 12:20:25 +030023 commandLine 'bundle', 'exec', 'jekyll', 'build'
Kirill Timofeeva5186962017-10-25 14:25:47 +030024}
25
26task clean(type: Delete) {
27 delete buildDir
28}
Roman Elizarov88f5b9d2017-12-28 17:54:08 +030029