-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
before_build however is working for me. Here is my tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "debug",
"file": "Demo.lpr",
"type": "fpc",
"presentation": {
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"buildOption": {
"unitOutputDir": "./out",
"customOptions": [
"-dDEBUG",
"-gw2"
]
}
},
{
"label": "release",
"file": "Demo.lpr",
"type": "fpc",
"presentation": {
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem"
},
"buildOption": {
"unitOutputDir": "./out",
"customOptions": [
"-dRELEASE",
"-O2"
]
},
"buildEvent": {
"before_build": [
"echo Before Build Works",
],
"after_build_success": [
"echo After Build Success",
],
"after_build_failure": [
"echo After Failed Build",
]
},
"group": {
"isDefault": true
}
}
]
}and using the default template...
program Demo;
{$mode objfpc}{$H+}
uses
Classes, SysUtils,
Demounit;
begin
WriteLn('Demo - Program with Unit Example');
WriteLn('Created by william on 28/03/2026');
// Call function from our unit
SayHello('william');
WriteLn('Current year: ', GetCurrentYear);
//err
//WriteLn('Press Enter to exit...');
//ReadLn;
end.The WriteLn and ReadLn at the bottom are commented out to prevent it from pausing. The commented line err is just there to force an error on build.
Result for successful build...
And for build error...
As you can see the echo commands are never run for after_build events? I have tried it with the before_build event removed and that made no difference. Thanks for any insight you have on this, William.
P.S. Just wanted to add I managed to get code auto-completion to work with the fpGUI Toolkit which is fantastic!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels