Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 1 | |
Roman Elizarov | 9fcb24f | 2018-03-06 11:25:09 +0300 | [diff] [blame] | 2 | def buildDocsDir = "$buildDir/docs" |
| 3 | |
Roman Elizarov | 8fc0075 | 2017-10-27 13:35:36 +0300 | [diff] [blame] | 4 | task copyDocs(type: Copy, dependsOn: rootProject.getTasksByName("dokka", true)) { |
| 5 | from (rootProject.getTasksByName("dokka", true).collect { "$it.project.buildDir/dokka" }) { |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 6 | include "**/*.md" |
Roman Elizarov | b418074 | 2018-05-16 12:50:36 +0300 | [diff] [blame] | 7 | include "**/package-list" |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 8 | } |
Roman Elizarov | 8fc0075 | 2017-10-27 13:35:36 +0300 | [diff] [blame] | 9 | from "docs" |
Roman Elizarov | 9fcb24f | 2018-03-06 11:25:09 +0300 | [diff] [blame] | 10 | into buildDocsDir |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 11 | } |
| 12 | |
Roman Elizarov | 88f5b9d | 2017-12-28 17:54:08 +0300 | [diff] [blame] | 13 | task copyExampleFrontendJs(type: Copy, dependsOn: ':example-frontend-js:bundle') { |
| 14 | def srcBuildDir = project(':example-frontend-js').buildDir |
| 15 | from "$srcBuildDir/dist" |
Roman Elizarov | 9fcb24f | 2018-03-06 11:25:09 +0300 | [diff] [blame] | 16 | into "$buildDocsDir/example-frontend-js" |
Roman Elizarov | 88f5b9d | 2017-12-28 17:54:08 +0300 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs, copyExampleFrontendJs]) { |
Roman Elizarov | 9fcb24f | 2018-03-06 11:25:09 +0300 | [diff] [blame] | 20 | inputs.files(fileTree(buildDocsDir)) |
| 21 | outputs.dir("$buildDir/dist") |
| 22 | workingDir file(buildDocsDir) |
Roman Elizarov | 97943c4 | 2018-01-13 12:20:25 +0300 | [diff] [blame] | 23 | commandLine 'bundle', 'exec', 'jekyll', 'build' |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | task clean(type: Delete) { |
| 27 | delete buildDir |
| 28 | } |
Roman Elizarov | 88f5b9d | 2017-12-28 17:54:08 +0300 | [diff] [blame] | 29 | |