How to include the current folder in the search path

0 votes
asked May 26, 2016 in Wanted features by anonymous

Currently, I have one uml (a.uml) file including another uml (b.uml), and both are in the same folder (windows). I currently have the include path set (-Dplantuml.include.path) to a configuration folder, but I would also want the current folder searched, such that when I include b.uml within a.uml, it will search the folder that contains a.uml and b.uml.

I have tried the following:

-Dplantuml.include.path="./;c:\Users\me\config"

-Dplantuml.include.path=".\;c:\Users\me\config"

-Dplantuml.include.path=".;c:\Users\me\config"

as well as (from within a.uml):

!include ./b.uml

!include .\b.uml

But none of these find b.uml. I am runnning this from within LyX, and there's no easy way to pass in the current folder, so that's why I was looking at the search path.

I hope that makes sense.

 

Thanks,

Brett

1 Answer

0 votes
answered May 26, 2016 by plantuml (182,820 points)

This makes 100% sense.

Which version of PlantUML are you using ? You can check if using

@startuml
version
@enduml


(Old versions might be buggy with includes)

I would also want the current folder searched, such that when I include b.uml within a.uml, it will search the folder that contains a.uml and b.uml.

This should be the default behaviour of PlantUML (at least, in last versions).

We've made a small example : https://dl.dropboxusercontent.com/u/13064071/include_test.zip

This zip contains the following files:

"main.uml" includes "a.uml", and "a.uml" includes "b.uml"

If we launch the following command from the root folder of the uncompressed zip file:

java -Dplantuml.include.path=included -jar plantuml.jar -verbose main/main.uml

We have the expected result. Maybe we did not exactly understand the situation, so do not hesitate to feedback!

 

 

commented May 26, 2016 by anonymous
This works, from the command line. However, when run through LyX, it doesn't work. I think since LyX is doing a system call, and it's not running in any context, it's not being handle properly :(

Not sure if there is some workaround in plantuml or if I'll have to figure out some workaround.
commented May 27, 2016 by plantuml (182,820 points)
Right now, we have not completely understood the behaviour within Lyx. So finding a workaround cannot be done yet. But we will :-)
The fact that LyX is doing a system call should not change the internal behaviour of PlantUML.

Could you double check that your version of PlantUML within LyX ? There is a risk that version in LyX and version using comand line are not the same. Thanks!

Could you also try within LyX:

A) With full path in both files
main.uml: !include c:/path/to/a.uml
a.uml: !include c:/path/to/b.uml

B) full path in main.uml only
main.uml: !include c:/path/to/a.uml
a.uml: !include b.uml

C) full path in a.uml only
main.uml: !include c:/path/to/a.uml
a.uml: !include b.uml

And tell us the result for case A, B and C.
commented May 31, 2016 by anonymous
I have a bat file, that I use on the command line, as well as within LyX, so it should using the same plantuml jar. I just (a few days ago) download latest plantuml and still experience the same problem. So, it's been tested with 8036 and 8041.

Note: I assume C) above should have a.uml and main.uml switched, correct?

Results (using 8036 and 8041) within LyX:

A) Works
B) Works
C) Does not work

BTW, this is my current workaround, is to include the full path in the include statement. But, this doesn't scale well, and is not cross platform :(

Thanks for your help!!
commented May 31, 2016 by plantuml (182,820 points)
Sorry, you're right. C should be read as:

C) full path in a.uml only
main.uml: !include a.uml
a.uml: !include c:/path/to/b.uml

So, if A) and B) are working, and not C)
It seems that the issue is not related to "include of include" (especially because B is working).
It's just the basic inclusion that does not work.

Could you try with a simplier test.
Do not use c:\users folder as it is a special folder.
Create two files main2.uml and c.uml

file c:\bar\main2.uml:
@startuml
!include c.uml
Alice -> Bob : I am main2.uml
@enduml

file c:\foo\c.uml:
Alice -> Bob : I am c.uml

Do not put quote in the command line, and launch:

cd c:\bar
java -Dplantuml.include.path=c:/foo -jar plantuml.jar -verbose main2.uml

And tell us the result.
Thanks!
commented Jun 10, 2016 by anonymous
Hi, sorry for the late reply....I thought I would get notification about this post, but I guess not :(

The above worked, even from LyX. However, what I want is for plantuml to look in the same folder for include files. For example, if I put c.uml in c:\bar\ along with main2.uml, then I want plantuml to be able to search for c.uml in the same folder as main2.uml.

If I do put c.uml in the same folder, and run plantuml from the command line, it words. However, it does not work from within LyX.

So, I need somehow for plantuml to search the same folder, or some way to specify in plantuml.include.path to search the same folder as the including file.

I hope this makes sense. Thanks for all your help, you guys are very helpful!!
commented Jun 10, 2016 by plantuml (182,820 points)
> If I do put c.uml in the same folder, and run plantuml from the command line, it words. However, it does not work from within LyX.

Do you have any idea of the command line launched by LyX ? It would help us to understand what's going on.

Here is also a special version of PlantUML https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

This version prints logs to help also us to better understand the situation. Could you install it in LyX and test it with the simple example main2.uml/c.uml beeing in the same folder ? Then send us the result (the logs are printed to standard output and err output)

Also, if you could, please send us a mail : it would be easier and faster.

Thanks!
...