New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutputDirectory problem on Windows #45
Comments
Yes I have just noted this behaviour today in a Windows machie. It is not a problem with relative or absolute path, if you pass a relative path it fails too. The major problem is that in linux it works as expected (in fact there are a lot unit tests which tests that feature), so I am not pretty sure what is exactly the reason. @LightGuard have you tried running the plugin on a Windows machine? I will try to take a look too today. |
Tried a few things and issues seems not located in asciidoctor-maven-plugin or asciidoctor-java-integration code. When I add the following line
this is within the org.asciidoc.maven.AsciidoctorMojo#execute method, then the document is generated in the directory c:/target/docs. So the JRuby threats all file names that doesn't start with / as relative and thus prepend it with the current directory. |
No, I have not tried running this on a windows machine, looks like I need to get my XP VM setup to do that (I think it has enough space in it). Being that this is a maven plugin I figured it was reasonable to assume things would be relative to the project, but we're seeing a problem on Windows where this is the full path, correct? |
yes, internally in asciidoctor-java-integration, I am calling getAbsolutePath() method from File class, so I think we can consider all paths as absolutes. |
Okay, should I prepend the absolute path of the project then? On Wed, May 15, 2013 at 9:39 AM, Alex Soto notifications@github.com wrote:
Jason Porter |
Not required you Can even use the . path and would fail too El dimecres 15 de maig de 2013, Jason Porter ha escrit:
Enviat amb Gmail Mobile |
Well, if windows isn't honoring '.' and prepending the path to the project won't work either, how are we supposed to fixt this? |
it is an strange behaviour because it only happens in Windows :S, do you think can be something related with Ruby? |
Have a look at my comment I made earlier. If we pass anything which isn't starting with '/' as OutputDirectory to the Ruby code, then it is prepended in Ruby (code of Dan Allen ??). So I think this should work:
probably it needs to be fixed in the asciidoctor-java-integration code |
I'm wondering if this code needs to be changed in the java-integration On Wed, May 15, 2013 at 10:35 AM, Rudy De Busscher <notifications@github.com
Jason Porter |
so you think that we can change toDir (and toFile because it happens too) attribute to receive an String instead of File, and then check the : character and passing from third. Right? |
Changes in the method org.asciidoctor.OptionsBuilder#toDir(File) . It would leave the parameters of type File so that you don't need to check if the String is a valid directory. And same for toFile(File) |
ok now I understand what you meaning, sorry, ok then I suggest to close this issue and open one in asciidoctor-java-integration |
Opening in asciidoctor-java-integration |
cool, can we remove support for Windows? 😆 |
Tested today (sorry for the delay) with 0.1.3.1 version and works as expected now. Thx |
When running on windows, I receive the following issue
Caused by: org.jruby.exceptions.RaiseException: (IOError) target directory does not exist: C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/target/generated-docs
at RUBY.render(jar:file:c:/maven_repository/org/asciidoctor/asciidoctor-java-integration/0.1.2/asciidoctor-java-integration-0.1.2.jar!/gems/asciidoctor-0.1.2/lib/asciidoctor.rb:811)
So it seems that path passed to JRuby script is expected to be relative to current directory but full path is supplied.
The text was updated successfully, but these errors were encountered: