71 lines
1.8 KiB
Groovy
71 lines
1.8 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
gradlePluginPortal()
|
|
}
|
|
dependencies {
|
|
/* wow. so recursion */
|
|
classpath "com.github.jruby-gradle:jruby-gradle-plugin:1.0.3"
|
|
}
|
|
}
|
|
apply plugin: 'org.ajoberstar.github-pages'
|
|
apply plugin: 'com.github.jruby-gradle.base'
|
|
|
|
import com.github.jrubygradle.JRubyExec
|
|
|
|
configurations {
|
|
asciidoctor
|
|
}
|
|
|
|
dependencies {
|
|
asciidoctor('rubygems:awestruct:0.5.5')
|
|
asciidoctor('rubygems:coderay:1.1.0')
|
|
|
|
/* later versions of 1.6.x have a dependency incompatibility with
|
|
* mime-types 2.x
|
|
*/
|
|
asciidoctor('rubygems:rest-client:1.6.7') { force = true }
|
|
}
|
|
|
|
task prepareGroovyDocs(type: Copy) {
|
|
description "Copy Groovydocs into our site directory for deployment/publication"
|
|
into "${buildDir}/_site/groovydoc"
|
|
|
|
rootProject.subprojects.each {
|
|
def task = it.tasks.findByName('groovydoc')
|
|
|
|
if ((task) && (task.outputs.files)) {
|
|
into(it.name) { from task.outputs.files }
|
|
}
|
|
}
|
|
dependsOn rootProject.subprojects.collect { ":${it.name}:groovydoc" }
|
|
}
|
|
|
|
task compileAsciidoc(type: JRubyExec) {
|
|
script 'awestruct'
|
|
scriptArgs "--generate", "--verbose",
|
|
"--output-dir", "${buildDir}/_site",
|
|
'--force'
|
|
/* without the --force option, awestruct is not smart enough to regenerate
|
|
* files based on includes */
|
|
configuration 'asciidoctor'
|
|
inputs.files fileTree(projectDir).include('**/*.adoc')
|
|
}
|
|
|
|
task assembleDocs {
|
|
dependsOn compileAsciidoc, prepareGroovyDocs
|
|
}
|
|
|
|
githubPages {
|
|
repoUri = 'git@github.com:jruby-gradle/jruby-gradle.github.io'
|
|
targetBranch = 'master'
|
|
pages {
|
|
from "${buildDir}/_site"
|
|
from "${rootProject.projectDir}/CNAME"
|
|
}
|
|
}
|
|
publishGhPages.dependsOn assembleDocs
|
|
|
|
/* We don't need an upload task in here */
|
|
//bintrayUpload.enabled = false
|