How to copy plist after 'Build all targets'?

Mac OSX specific forum
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

How to copy plist after 'Build all targets'?

Post by WilliamL »

I made a little program to copy my plist to the executable (since, on creating an app a default plist is created). Is there a way to run this little program automatically upon creating the executable (in my case I'm using 'Build all targets')? ...or is there a better way to do this?
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: How to copy plist after 'Build all targets'?

Post by freak »

Just configure a tool to be executed on the "After create executable" trigger. This is also executed during the project build process. You can check whether this worked by looking at the build log. Any tools that are executed during 'Build all targets' are shown there.
quidquid Latine dictum sit altum videtur
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: How to copy plist after 'Build all targets'?

Post by WilliamL »

I thought of that and even tried it but it didn't seen to work.

I guess you can only have a .pb file as a tool (in this case my copy program) and not an app (won't let you select it). I wondered if the event loop in the copy program would stop the program but it didn't. I'm a little puzzled by this behavior. I also wonder if the tool will run after any program I build? Will I have to 'uncheck' the tool to keep that from happening?

It worked! The only way to tell it worked was to look at the log (also in this case if the plist is my copy and not the default).

Thanks freak, this is a time-saver.

[edit-later]
The file has a new create date, because of the new default file, but the file has not been replaced. It is not working. (see below)
Last edited by WilliamL on Fri Jan 14, 2011 11:09 pm, edited 2 times in total.
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: How to copy plist after 'Build all targets'?

Post by WilliamL »

I tried to get LPP to work as a tool and, since it didn't work, it brings up many questions. Like...
-Does the tool have to be a .app or a .pb?
-Why doesn't browse, in Commandline:, allow selecting apps?
-What happens to the event loop in my program that I mentioned above?

I made a tool of one line MessageRequester("Tool","Continue") and created an .app out of it. I selected a trigger of 'Before Compile/Run' and 'Wait until tool quits' and ran the IDE and saw what happened. The tool seemed to be ignored. Why doesn't this work?

What would be an example I could test to see if the Tool function is working?

[later]
Note: Tools are created using 'Console' option when creating the executable.
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
Post Reply