Files
spring-credhub/spring-credhub-docs/build.gradle

95 lines
2.3 KiB
Groovy

/*
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'org.asciidoctor.convert'
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
}
}
description = "Spring CredHub Documentation"
apply plugin: 'org.asciidoctor.convert'
repositories {
maven { url "https://repo.spring.io/libs-release-local" }
mavenCentral()
}
configurations {
docs
}
dependencies {
compile project(":spring-credhub-core")
compile("io.projectreactor:reactor-core")
docs("io.spring.docresources:spring-doc-resources:0.1.0.RELEASE@zip")
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
// copy doc resources
from {
configurations.docs.collect { zipTree(it) }
}
// and doc sources
from "src/docs/asciidoc"
// to a temporary build directory
into "$buildDir/asciidoc"
}
asciidoctor {
sourceDir = file("$buildDir/asciidoc")
sources {
include '*.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
logDocuments = true
backends = ["html5"]
options doctype: 'book', eruby: 'erubis'
attributes 'icons': 'font',
'idprefix': '',
'idseparator': '-',
docinfo: 'shared',
revnumber: project.version,
'spring-version': project.version,
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'master' : "v${project.version}",
sectanchors: '',
sectnums: '',
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'nofooter': true,
'allow-uri-read': '',
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable'
}
asciidoctor.dependsOn prepareAsciidocBuild
configurations.archives.artifacts.clear()