asciidoctor-gradle-plugin icon indicating copy to clipboard operation
asciidoctor-gradle-plugin copied to clipboard

Useless rebuilding in asciidoctorPdf

Open thomas-huegel opened this issue 5 years ago • 2 comments

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.

thomas-huegel avatar Sep 30 '20 06:09 thomas-huegel

Hey @thomas-hugel, we are well aware of this potential enhancement, but it is not a trivial change and nobody has had the time to tackle something of this scope.

ysb33r avatar Oct 02 '20 13:10 ysb33r