asciidoctor/asciidoctor-gradle-plugin

Useless rebuilding in asciidoctorPdf

Open

#574 opened on Sep 30, 2020

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Groovy (110 forks)batch import
help wanted

Repository metrics

Stars
 (265 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi there, I want to make pdfs from all adoc files from some source directory, one pdf per adoc. When I remove any target.pdf file, all of the source files get built again. The same thing occurs when I modify any of the source files. I would expect that only the source.adoc corresponding to the removed / outdated target be rebuilt. Here is my build.gradle:

plugins {
  id 'org.asciidoctor.jvm.pdf' version '3.1.0'
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'org.asciidoctor.jvm.pdf'

    repositories {
        jcenter()
    }

    pdfThemes {
        local 'basic', { 
            themeDir = file('../themes') 
            themeName = 'basic' 
        }
    } 
    
    asciidoctorPdf {
        baseDirFollowsSourceFile()
        
        logDocuments true

        sourceDir file('../adoc')
        sources {
            include '*'
        }
        outputDir file('.')

        theme 'basic'

        asciidoctorj {
            modules {
               diagram.use() 
            }
            requires 'rouge'
            fatalWarnings ~/:/
            attributes 'build-gradle': file('build.gradle'),
                'attribute-missing': 'warn'
        }
    }
}

Am I missing anything? Thanks.

Contributor guide