kordamp / markdown-gradle-plugin

Markdown/HTML plugin for gradle
Apache License 2.0
71 stars 51 forks source link

Asynchronious execution ? #26

Open verglor opened 5 years ago

verglor commented 5 years ago

Hi, I am trying to postprocess generated html but it seems it is not written to buildDir before the markdownToHtml task ends.

The following task dependent on markdownToHtml is trying to read content of generated html and insert it into another template html but fails on the missing file:

task compileReadme(type: Copy, dependsOn: markdownToHtml) {
    from 'src/html'
    into buildDir
//    Thread.sleep(3000)
    filter(ReplaceTokens, tokens: [BODY: file("$buildDir/gen-html/README.html") ])
}

If I add some sleep to wait until the generated file is actually written to buildDir it works as expected.

Shouldn't the task wait until the output files are written to buildDir before it finishes and tasks that are dependent on it starts ?