Menu

#222 Shouldn't the search path be relative to the config file?

v0.23Beta_
open
TridenT
5
2012-07-18
2009-11-26
Mark Daems
No

Shouldn't the search path be relative to the config file instead of relative to the GUI exe?
When running the GUI from it's installaton dir and opening the documentation config generation doesn't work.
Eg:
d:\dctd\delphicodetodoc.exe
d:\zeoslib\documentation\dctd.xml
d:\zeoslib\src\xxx.pas ....

going to the d:\zeoslib\documentation dir and running the gui from there works just fine.

Mark

Discussion

  • TridenT

    TridenT - 2009-11-28

    HI Mark, well, maybe there is an issue. First I need to understand your problem. You use relative path for input files and output generation right ? And with the dctd gui, it doesn't work if the gui exe is moved in the directory tree ?

    If so, I need to explain you this choice.
    1/ A config file should work the same way with the gui or the command line
    2/ With the command line, as many (most?) of cmd line utility, the relative path are from the current directory.
    So I can do :
    cd d:\MyFolder
    c:\dctd\dctd_cmd.exe ..\MyDocument\MyProject.xml
    The relative folder from xml file will apply FROM the current folder -> d:\MyFolder, even if config file folder and exe fodler are different

    I hope my explanation was clear ! Do you see an issue with this ? Do you have a better idea ?

     
  • Mark Daems

    Mark Daems - 2009-11-28

    Well, it works fine wherever the gui exe is situated. The problem is : you must start the program from the same directory as the config file of your project. So exactly typing the full path to the exe.
    This behaviour is particularly difficult with the GUI, as a gui user clicks the exe or a shortcut. Then you usualy are running from the gui's directory.
    Don't know if you still have a zeoslib snapshot around?
    Just run the DCTD gui from your standard location and then open the config in <zeos_root>\documentation\Zeoslibcode2doc.xml Then he doesn't find the relative paths in de config.
    I see 2 solutions :
    - when opening a config file set the working dir to the directory containing the config file
    - expand all relative paths with the path of the config file.

    Same behaviour would be practical with the command line version. So the user doesn't have to change directories when scripting his release build. Just calling the command line program and pointing to the config file would do the job.

    Mark

     
  • TridenT

    TridenT - 2009-12-03

    Mark, can you sned me link to http svn access or link to zeoslib snapshot in direct download ?
    I need the source code to test this issue !

     
  • TridenT

    TridenT - 2009-12-03

    ok Mark, thx for the links.
    I tried to generate the documentation by directly opening [zeos\documentation\Zeoslibcode2doc.xml] and it works !
    So when using the DelphiCodeToDoc v0.23b3 window application, the relative path is taken from the config file.
    I'm a bit confused, but there is a long time I've work on this feature !
    So the IDE is ok with relative path from the gui.
    Command line is not working with fixed path (I've just test it, it is broken!).
    So I will fix it now, as I understand the issue !
    I will send an email when I'm finish with the fix and the tests.

     
  • TridenT

    TridenT - 2009-12-08

    Fixed in v0.23b4

     
  • Mark Daems

    Mark Daems - 2009-12-09

    GUI tested and functionality confirmed
    Quick command line test fails, apparently:
    D:\temp>dctd_cmd D:\ZEOSTesting\documentation\testdelphicode2doc_comp.xml
    Using config file : D:\ZEOSTesting\documentation\testdelphicode2doc_comp.xml
    Error while loading Project

     
  • TridenT

    TridenT - 2009-12-09

    Mark, the latest DelphiCodeToDoc was commited yesterday @ 22h37 but the latest automated build failed. So the link to the latest version has an EXE from yesterday @ 20h.

    I cannot connect now to my server @home, I will fix this this evening.
    Sorry for the problem.

    I had tested the command line and the gui with zeos project, it works perfectly !

     
  • Mark Daems

    Mark Daems - 2009-12-09

    Got today's 6 o'clock build and now it works exactly as I hoped it would. Thanks very much, Now DCTD has a very useful extra feature!

    You can mark the issue closed.

    Mark

     
  • TridenT

    TridenT - 2009-12-10

    Gooood!
    I will close it once it is release in a public version.
    By now, it is marked 'fixed'.

     

Anonymous
Anonymous

Add attachments
Cancel