Re: asciidoctor-ant: why no directories starting with '_' in the entire absolute path?
A file or folder which begins with underscore (or a dot) is considered hidden throughout the Asciidoctor ecosystem and is thus ignored from processing (a common convention elsewhere as well). So the behavior you are observing is by design.
Since all of your docs are inside the folder that begins with an underscore, you might be able to work around it by setting the sourceDirectory to "_loadbuild/docs/adoc". The scanner should only be checking for the leading underscore on files and folders inside the source directory, not in the source directory path itself. (according to https://github.com/asciidoctor/asciidoctor-ant/issues/54, this does not work as it should)
On Thu, May 26, 2016 at 2:27 PM, Julie [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm trying to use the asciidoctor-ant task through cygwin, and bumped into a problem with the task ignoring all my files because my files live in a subdirectory of my loadbuild output directory, which happens to start with a '_'.
/project - contains build.xml
/project/_loadbuild - target for all loadbuild activities
/project/_loadbuild/docs/adoc - home of some (generated) .adoc files
/project/_loadbuild/docs/output - target directory for html files
My ant task parameters specify "sourceDirectory=docs/adoc" and "outputDirectory=docs/html".
I added debugging statements to AsciidoctorAntTask, and I can see that directoryWalker.scan() is returning a list of ~50 files (correct), but then they're all getting removed by secondary looping that's happening in scanSourceFiles(), where the parent directory of each file is checked to see if it starts with an '_'.
I can also see that the getAbsolutePath() result of everyone of those files starts with c:\... I'm speculating that this means that the directory matching loop stop on line 279 won't work against a relative path as the sourceDirectory.
Is this deliberate behaviour? If so, can anyone think of a workaround? Specifying absolute windows paths to ant in cygwin seems fraught with peril. So does changing the name of the _loadbuild directory, which could affect a lot of downstream tooling.
If you reply to this email, your message will be added to the discussion below: