Re: asciidoctor-ant: why no directories starting with '_' in the entire absolute path?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asciidoctor-ant: why no directories starting with '_' in the entire absolute path?

mojavelinux
Administrator
Julie,

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)

I would consider it reasonable to introduce an option to include hidden directories, or perhaps control the ignore pattern. Please file an issue in the Ant plugin project at https://github.com/asciidoctor/asciidoctor-ant/issues.

Cheers, 

-Dan

On Thu, May 26, 2016 at 2:27 PM, Julie [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

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 '_'.

Example:

/project - contains build.xml
/project/_loadbuild - target for all loadbuild activities
/project/_loadbuild/docs
/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.

Thanks,
Julie


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/asciidoctor-ant-why-no-directories-starting-with-in-the-entire-absolute-path-tp4730.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Loading...