blob: c754880bce6d4cfd3367a8b8ebae5c499ad4d6cf [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
*
* http://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.
*/
description = "Apache Zestâ„¢ Manuals and Website."
dependencies {
compile( project( ":org.qi4j.core:org.qi4j.core.bootstrap" ) )
compile( project( ":org.qi4j.libraries:org.qi4j.library.constraints" ) )
compile( project( ":org.qi4j.libraries:org.qi4j.library.logging" ) )
runtime( project( ":org.qi4j.core:org.qi4j.core.runtime" ) )
runtime( libraries.slf4j_simple )
}
//task userguide( type: org.qi4j.gradle.plugin.documentation.Documentation ) {
// docName = 'userguide'
// docType = 'book'
//}
//
//task recipes( type: org.qi4j.gradle.plugin.documentation.Documentation ) {
// docName = 'recipes'
// docType = 'article'
//}
//
//task referenceManual( type: org.qi4j.gradle.plugin.documentation.Documentation ) {
// docName = 'reference'
// docType = 'book'
//}
task website( type: org.qi4j.gradle.plugin.Documentation,
dependsOn: rootProject.allprojects.tasks.flatten().findAll { it.name == AsciidocBuildInfo.TASK_NAME } ) {
docName 'website'
docType 'article'
}
task archiveWebsite( type: Copy ) {
dependsOn website
if( rootProject.version == '0' || rootProject.version.contains( "SNAPSHOT" ) )
{
into( "$rootProject.projectDir/../zest-web/site/content/java/develop" )
}
else
{
into( "$rootProject.projectDir/../zest-web/site/content/java/$version" )
}
from( 'build/docs/website/' )
}
task copyWebsite( type: Copy ) {
dependsOn archiveWebsite
if( rootProject.version != '0' && !rootProject.version.contains( "SNAPSHOT" ) )
{
from( "$rootProject.projectDir/../zest-web/site/content/java/$version/" )
into( "$rootProject.projectDir/../zest-web/site/content/java/latest/" )
}
}
task manuals() {
dependsOn copyWebsite
// dependsOn userguide
// dependsOn referenceManual
// dependsOn recipes
}
// Skip if asciidoc is not found in PATH when building a 0 or SNAPSHOT version,
// or if skipAsciidocIfAbsent property is set and asciidoc is not found in PATH
[ website, archiveWebsite, copyWebsite, manuals ]*.onlyIf {
def skipAsciidocIfAbsent = rootProject.hasProperty( 'skipAsciidocIfAbsent' ) ? rootProject.skipAsciidocIfAbsent : false
def pathDirs = System.getenv( 'PATH' ).split( File.pathSeparator )
def present = pathDirs.collect( { new File( it, 'asciidoc') } ).flatten().findAll( { it.isFile() } )
if( !skipAsciidocIfAbsent && version != '0' && !version.contains( 'SNAPSHOT' ) ) {
project.logger.debug 'Asciidoc tasks forced because version is no-0 and no-SNAPSHOT, hope you have Asciidoc installed'
return true
}
if( !present ) {
project.logger.warn 'Asciidoc not found in PATH, manual tasks will skip, please install http://www.methods.co.nz/asciidoc/'
}
present
}