asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
286 stars 122 forks source link

Useless rebuilding in asciidoctorPdf #574

Open thomas-huegel opened 4 years ago

thomas-huegel commented 4 years ago

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.

ysb33r commented 4 years ago

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.