ZEST-25 Add skipAsciidocIfAbsent build property set in src dist gradle.properties
Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/57a18582 Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/57a18582 Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/57a18582 Branch: refs/heads/develop Commit: 57a18582d1b2b9d1cbda77fc1cd5e525f0da447b Parents: e48c4e5 Author: Paul Merlin <[email protected]> Authored: Wed Jul 22 15:20:01 2015 +0200 Committer: Paul Merlin <[email protected]> Committed: Wed Jul 22 15:20:01 2015 +0200 ---------------------------------------------------------------------- build.gradle | 2 +- manual/build.gradle | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/57a18582/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 36086f0..a5fd847 100644 --- a/build.gradle +++ b/build.gradle @@ -749,7 +749,7 @@ task srcDistFilteredFiles() { // gradle.properties def gradlePropsFile = new File( filteredDir, 'gradle.properties' ) gradlePropsFile.parentFile.mkdirs() - gradlePropsFile.text = project.file( 'gradle.properties' ).text + "\nskipSigning=true\n\nversion=$version\n" + gradlePropsFile.text = project.file( 'gradle.properties' ).text + "\nskipSigning=true\nskipAsciidocIfAbsent=true\n\nversion=$version\n" } } http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/57a18582/manual/build.gradle ---------------------------------------------------------------------- diff --git a/manual/build.gradle b/manual/build.gradle index 3d6d8cf..403dd27 100644 --- a/manual/build.gradle +++ b/manual/build.gradle @@ -79,15 +79,18 @@ task manuals() { // dependsOn recipes } -// Skip if asciidoc is not present when building a 0 or SNAPSHOT version +// 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 { - if( version != '0' && !version.contains( 'SNAPSHOT' ) ) { - return true - } + 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, manual tasks will skip, please install http://www.methods.co.nz/asciidoc/' + project.logger.warn 'Asciidoc not found in PATH, manual tasks will skip, please install http://www.methods.co.nz/asciidoc/' } present }
