Skip to content
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

Deprecation of Options destinationDir #941

Closed
abelsromero opened this issue Jul 28, 2020 · 2 comments · Fixed by #1153 or #1154
Closed

Deprecation of Options destinationDir #941

abelsromero opened this issue Jul 28, 2020 · 2 comments · Fixed by #1153 or #1154

Comments

@abelsromero
Copy link
Member

I am confused about the use of destinationDir vs toDir, I suspect they are the same and maybe the first one could be marked as deprecated to avoid confusion to users.
Seeing this code
https://github.com/asciidoctor/asciidoctor/blob/1d61da9ee0aba63711c415fa629a80f275036aa4/lib/asciidoctor/cli/invoker.rb#L59 and the user manual https://asciidoctor.org/docs/user-manual/#ruby-api-options, seems pretty obvious but I wanted to contrast and maybe check if this has some history reason.

@robertpanzer
Copy link
Member

Interesting. We definitely need to do some investigation on this.
For the command line option we follow the behavior of the Asciidoctor Ruby Invoker and set to_dir:

if (isDestinationDirOption() && !isOutputStdout()) {
optionsBuilder.toDir(new File(this.destinationDir));

But I can imagine that calling Options.setDestinationDir() could be completely useless, just looking at the code it seems like Asciidoctor would never look at this option when set from the API.

@abelsromero
Copy link
Member Author

It seems to me destinationDir is just a front-end for to_dir. I suspect for Python compatiblity https://github.com/asciidoc/asciidoc-py3/search?q=destination%3A&unscoped_q=destination%3A. While there's a mention of destinationDir and destination_dir in the code, there's no to_dir.

abelsromero added a commit to abelsromero/asciidoctorj that referenced this issue Mar 30, 2023
The option only is used for the CLI, in that case
the value is redirected to 'to_dir'.

Fixes asciidoctor#853
Fixes asciidoctor#941
abelsromero added a commit to abelsromero/asciidoctorj that referenced this issue Mar 30, 2023
The option only is used for the CLI, in that case
the value is redirected to 'to_dir'.

Fixes asciidoctor#853
Fixes asciidoctor#941
abelsromero added a commit to abelsromero/asciidoctorj that referenced this issue Mar 30, 2023
Fix option to set ToDir internally.
Deprecate destinationDir in Options and OptionsBuilder.
Add JavaDoc pointing users to use toDir.

Fixes asciidoctor#853
Fixes asciidoctor#941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants