[Lazarus] It is a beautiful day...

Ondrej Pokorny lazarus at kluug.net
Sun Aug 11 11:56:38 CEST 2019


On 11.07.2019 17:46, Michael Van Canneyt via lazarus wrote:
> The IDE now has proper support for Project groups.

Hello,

I started to use Project groups and also added the .lpg file to my 
repository. I found out that the XML format is unusual (wrong). The 
<Mode*> nodes are not subnodes to <BuildModes>:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
   <ProjectGroup FileVersion="1">
     <Targets Count="18">
       <Target0 FileName="xyz.lpi">
         <BuildModes Count="2"/>
         <Mode1 Name="Debug" Compile="True"/>
         <Mode2 Name="Release"/>
       </Target0>

Is this an intention?

I ask because I wanted to update the file format to the new Lazarus XML 
format (without the indexes and count attributes):

<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
   <ProjectGroup FileVersion="1">
     <Targets>
       <Target FileName="xyz.lpi">
         <BuildModes>
           <Mode Name="Debug" Compile="True"/>
           <Mode Name="Release"/>
         </BuildModes>
       </Target>

and I have already helper functions for distinguishing between the old 
and the new file formats but they can handle only the "correct" old 
format (where item nodes are subnodes of the main node):
         <BuildModes Count="2"/>
           <Mode1 Name="Debug" Compile="True"/>
           <Mode2 Name="Release"/>
         </BuildModes>

My question: because Project groups are usable only in trunk, I suggest 
to fix the old file format without backwards-compatibility:
         <BuildModes Count="2"/>
           <Mode1 Name="Debug" Compile="True"/>
           <Mode2 Name="Release"/>
         </BuildModes>

That would mean that the Compile flags for build modes get lost and the 
user must set them again. Are you fine with it? (Well, I am fine with that.)

Best
Ondrej



More information about the lazarus mailing list