When making available some projects for educational assignments, I noticed some differences between very similar projects (how they open in Lazarus, i.e. what files open in what state).
I compared their *.lpi files and saw some strange things. I did have some struggles in getting the projects to incorporate the intended units.
For one thing, in the Units section, there were several units (in one case even duplicates) that were no longer used and also were not visible in the Project Inspector (nor opened in the editor).
I would like to tidy up these project files to ensure that the students get "clean" projects (cursor at beginning, files opened in a standard order, no unnecessary files mentioned, etc.).
How can I find out about what information is where in *.lpi?
<Units Count="n"> says there are n units in the project
Each unit is described by a <Unitx> block, with some attributes, e.g.:
<Filename Value="main.pas"/>
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="main.lrs"/>
<UnitName Value="Main"/>
<CursorPos X="29" Y="64"/>
<TopLine Value="56"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
I think the "invisible" units did not have a IsPartOfProject tag set. Why are they there (not because they were open in the editor, because they are no longer reopened? I some cases I saw paths like ..\ProjectFolder\main.pas, which would much better be just main.pas. This cannot easily be corrected in the Project Inspector.
I conjecture the following meanings:
Loaded: whether the editor opens this file when opening the project EditorIndex: in what tab position the opened file occurs TopLine: what line number appears at the top of the screen CursorPos: position of cursor
UsageCount: ??? <<<<<< please explain
There is plenty of room for making a mess of it (especially if you edit this manually). Is there an easy way to write a small utility (even better: integrate this into Lazarus) to "clean up" a project: remove unused units, reset cursor to top of file, etc.
Also, it appears there is some additional history information (e.g. JumpHistory) in the *.lpi file which you may not want to leak when making the project available to others. What is this for?
What is the Debugging section for? It has and Exceptions section.
Tom
