[Lazarus] It is a beautiful day...

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Aug 11 12:23:24 CEST 2019


On Sun, 11 Aug 2019 11:56:38 +0200
Ondrej Pokorny via lazarus <lazarus at lists.lazarus-ide.org> wrote:

> 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?

No

 
> 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,

Project groups are in 2.0.


> 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.)

I guess with a few lines of code you can read the old format and set
the "Compile" flag.

Mattias




More information about the lazarus mailing list