Closed halitanildonmez closed 4 years ago
In summary, the pdf-fontsdir attribute can accept multiple paths. Multiple entries must be separated by either a comma or a semi-colon (but not a colon).
It properly makes sense for the Gradle property to accept either a string or an Array, then prepare the value accordingly for Asciidoctor PDF.
Right, I see what is gong on here. Gradle validates the single path so that i knows whether it has changes. What we need here is the ability to supply Gradle with a list of directories, which is can then check and finally before calling the converter conctenate the list of paths using the OS path separator.
For this I'll need to deprecate the current method and add an additional one which can take more than one path.
:+1: setFontDirs seems like the logical choice.
Just out of curiosity: can I tackle this one ? Or has it already been solved ?
@halitanildonmez Please go ahead an try. I'll be happy to review and provide feedback on the PR. (please do it against the development-3.x branch and not master).
Ok forking and working on it.
I have updated some files but have a quick question: how can I test this ? I ma updating "intTest" but not sure that is the correct place ?
I have updated some files but have a quick question: how can I test this ? I ma updating "intTest" but not sure that is the correct place ?
test
for basic unit tests that does not require running a build as part of a testintTest
for doing exactly thatgradleTest
for compatibility testingQuestion: right now the font path is a file. What I am trying is to return a list of files. I was thinking of using @InputFiles annotation. Would that be the correct thing to do ?
That is the correct approach. Remember that you need to leave the old method in place and annotate it with @Deprecated
. You can remove the @InputFile
annotation from that and forward the method to call your new method with the single file.
I have been working on this and right now I am doing this: https://github.com/halitanildonmez/asciidoctor-gradle-plugin/commit/b680bc9afb5566fab131259ec797538985ca951a
Yet I do not know how to verify and whether this is what you mean ?
For getFontsDir
:
@Deprecated
getFontsDirs
, getFontDir
should throw an exception.getFontDirs
only returns one directory then `getFontDir returns that directory.Fixed I think. @ysb33r can you take a look at the merge request ? I can add more tests or any other test you want
Did:
setFontsDir("GEM_FONTS_DIR;$sourceDir/user-guide/resources")
Happened:
Directory 'H:\Projects\OpenSource\Java\junit5\documentation\src\docs\asciidoc\user-guide\resources;GEM_FONTS_DIR' specified for property 'fontsDir' does not exist.
Expected:
See also https://github.com/junit-team/junit5/issues/2315#issuecomment-667431555