Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-24 Thread Luca Olivetti via lazarus

El 24/5/24 a les 18:05, Marc Weustink via lazarus ha escrit:

And even if I use a different rc file with {$R myspec.rc}, if the 
source file with the directive doesn't change it won't be automtically 
recompiled so no regeneration of the resource file would take place, 
even if one of the files in myspec.rc has changed, right?


Yes. The IDE/Compiler have no knowledge what you put in the .rc
If you don't want the have it rebuild every time you need some logic in 
your "rc builder" you call in the prebuild step


But if I use the "resources" section in the project options *and* put 
the file in the project, the IDE could check that the file changed and 
regenerate the resource file ;-)
(which is what I supposed it did: even if the wiki page doesn't say it 
explicitly it seems to imply so).


Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-24 Thread Marc Weustink via lazarus




On 23/05/2024 22:01, Luca Olivetti via lazarus wrote:

El 23/5/24 a les 21:46, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit:
In this case, don't use the project.res, but use your own. You can 
include multiple resource files. So you can generate it before.


I just followed the instructions here (and have been doing it for many 
years, even if this is the first time I tried to generate the file 
with "Execute before"):


https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources

though it doesn't say exactly when it is regenerated ("depending on 
the actions taken in the IDE") it also says "it is therefore a good 
idea to add the files that are indicated here to the project file as 
well".


And even if I use a different rc file with {$R myspec.rc}, if the source 
file with the directive doesn't change it won't be automtically 
recompiled so no regeneration of the resource file would take place, 
even if one of the files in myspec.rc has changed, right?


Yes. The IDE/Compiler have no knowledge what you put in the .rc
If you don't want the have it rebuild every time you need some logic in 
your "rc builder" you call in the prebuild step


Marc
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 21:46, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit:
In this case, don't use the project.res, but use your own. You can 
include multiple resource files. So you can generate it before.


I just followed the instructions here (and have been doing it for many 
years, even if this is the first time I tried to generate the file with 
"Execute before"):


https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources

though it doesn't say exactly when it is regenerated ("depending on the 
actions taken in the IDE") it also says "it is therefore a good idea to 
add the files that are indicated here to the project file as well".


And even if I use a different rc file with {$R myspec.rc}, if the source 
file with the directive doesn't change it won't be automtically 
recompiled so no regeneration of the resource file would take place, 
even if one of the files in myspec.rc has changed, right?


Bye





Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the 
executable, but it seems the command is executed after the 
resources are compiled (there's a message complaining that the file 
is not found and in fact when I execute the program the resource is 
not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added 
those files to the project to be sure they're tracked by lazarus) are 
working by pure luck.
Or not, since a save happens anyway when the file is modified with 
the lazarus editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not 
currently opened in lazarus (so it won't prompt me to reload it) and 
I press compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like 
to be sure that my project work by design and not by chance.


Bye





--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit:

In this case, don't use the project.res, but use your own. You can include 
multiple resource files. So you can generate it before.


I just followed the instructions here (and have been doing it for many 
years, even if this is the first time I tried to generate the file with 
"Execute before"):


https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources

though it doesn't say exactly when it is regenerated ("depending on the 
actions taken in the IDE") it also says "it is therefore a good idea to 
add the files that are indicated here to the project file as well".


Bye




Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to generate a 
file that will be embedded as a resource in the executable, but it seems the command is executed after 
the resources are compiled (there's a message complaining that the file is not found and in fact when 
I execute the program the resource is not available).
Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added those 
files to the project to be sure they're tracked by lazarus) are working by pure 
luck.
Or not, since a save happens anyway when the file is modified with the lazarus 
editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not currently 
opened in lazarus (so it won't prompt me to reload it) and I press 
compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like to be sure 
that my project work by design and not by chance.

Bye



--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Marc Weustink via lazarus
In this case, don't use the project.res, but use your own. You can include 
multiple resource files. So you can generate it before.

Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:
>El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:
>> 
>> 
>> On 5/22/24 15:03, Luca Olivetti via lazarus wrote:
>>> Hello,
>>> 
>>> I'm trying to use the "Compiler commands" -> "Execute before" to generate a 
>>> file that will be embedded as a resource in the executable, but it seems 
>>> the command is executed after the resources are compiled (there's a message 
>>> complaining that the file is not found and in fact when I execute the 
>>> program the resource is not available).
>>> Is there a way around it, other than executing the command manually?
>> 
>> If you mean the project .res file:
>> That is updated on save, which is independent of compile.
>
>Ouch, so my projects that embed files as resources (and I also added those 
>files to the project to be sure they're tracked by lazarus) are working by 
>pure luck.
>Or not, since a save happens anyway when the file is modified with the lazarus 
>editor and I use compile or build, right?
>What happens if I edit the file with an external editor, it's not currently 
>opened in lazarus (so it won't prompt me to reload it) and I press 
>compile/build/run? Will the .res be regenerated or not?
>As I said, for the problem at hand I changed the logic, but I'd like to be 
>sure that my project work by design and not by chance.
>
>Bye
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added 
those files to the project to be sure they're tracked by lazarus) are 
working by pure luck.
Or not, since a save happens anyway when the file is modified with the 
lazarus editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not 
currently opened in lazarus (so it won't prompt me to reload it) and I 
press compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like to 
be sure that my project work by design and not by chance.


Bye

--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Mattias Gaertner via lazarus




On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.

Mattias

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 22/5/24 a les 15:03, Luca Olivetti via lazarus ha escrit:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


never mind, now I generate the file inside my program.

Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] "Execute before" is executed after resource generation?

2024-05-22 Thread Luca Olivetti via lazarus

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?

Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus