Skip to content

Commit

Permalink
+18
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Jun 24, 2023
1 parent 578ccaa commit 9eb6739
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/on commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
Write-Host "Compile: " -NoNewline
Start-Process -FilePath 'D:\PABCNETC\pabcnetcclear.exe' -ArgumentList '"PackAll.pas"' -Wait -NoNewWindow
Start-Process -FilePath 'PackAll.exe' -ArgumentList '"Stages= FirstPack + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=D:\PABCNETC\pabcnetcclear.exe"' -Wait -NoNewWindow
Start-Process -FilePath 'PackAll.exe' -ArgumentList '"Stages= FirstPack + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=D:\PABCNETC\pabcnetcclear.exe" SkipFinishedPause' -Wait -NoNewWindow
if ($?) {
Exit $?
}
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
run: |
"../PABCNETC/pabcnetcclear.exe" "PackAll.pas"
"PackAll.exe" "Stages= FirstPack + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=../PABCNETC/pabcnetcclear.exe"
"PackAll.exe" "Stages= FirstPack + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=../PABCNETC/pabcnetcclear.exe" SkipFinishedPause
- name: Check for changes
run: |
Expand Down
3 changes: 2 additions & 1 deletion POCGL_Utils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function GetFullPathRTA(fname: string)
function GetRelativePath(fname: string; base_folder: string := System.Environment.CurrentDirectory) := PathUtils.GetRelativePath(fname, base_folder);
function GetRelativePathRTA(fname: string) := PathUtils.GetRelativePathRTA(fname);

function is_separate_execution := Logger.main is ConsoleLogger;
function IsSeparateExecution := AOtp.IsSeparateExecution;
procedure FinishedPause := AOtp.FinishedPause;

function nfi := FileLogger.nfi;
function enc := FileLogger.enc;
Expand Down
2 changes: 1 addition & 1 deletion Packing/Descriptions/PackDescriptions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ FileLogData = record
var fls := GetArgs('fname').ToArray;
var use_pd := 'UseLastPreDoc' in CommandLineArgs;

if is_separate_execution and string.IsNullOrWhiteSpace(nick) and (fls.Length=0) and not use_pd then
if IsSeparateExecution and string.IsNullOrWhiteSpace(nick) and (fls.Length=0) and not use_pd then
begin

// nick := 'OpenCL';
Expand Down
2 changes: 1 addition & 1 deletion Packing/Template/Pack Template.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var nick := GetArgs('nick').SingleOrDefault;
var dir := GetArgs('dir').SingleOrDefault;

if is_separate_execution and string.IsNullOrWhiteSpace(inp_fname) and string.IsNullOrWhiteSpace(otp_fname) and string.IsNullOrWhiteSpace(nick) then
if IsSeparateExecution and string.IsNullOrWhiteSpace(inp_fname) and string.IsNullOrWhiteSpace(otp_fname) and string.IsNullOrWhiteSpace(nick) then
begin

// inp_fname := 'Modules/Template/OpenGL.pas';
Expand Down
28 changes: 16 additions & 12 deletions Utils/AOtp.pas
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ procedure StartBgThread(p: ()->());
procedure Otp(line: OtpLine);
procedure ErrOtp(e: Exception);

function IsSeparateExecution: boolean;
procedure FinishedPause;

implementation

uses PathUtils;
Expand Down Expand Up @@ -348,28 +351,29 @@ procedure ErrOtp(e: Exception);
end;
end;

if Logger.main is ConsoleLogger then
begin
if '[REDIRECTIOMODE]' not in System.Environment.GetCommandLineArgs.Skip(1).Take(1) then
ReadString(#10'Press Enter to exit:');
end;
FinishedPause;
Halt(e.HResult);

end;

function IsSeparateExecution := Logger.main is ConsoleLogger;
procedure FinishedPause;
begin
if not IsSeparateExecution then exit;
if '[REDIRECTIOMODE]' in System.Environment.GetCommandLineArgs.Skip(1).Take(1) then exit;
if 'SkipFinishedPause' in CommandLineArgs then exit;
ReadString(#10'Press Enter to exit:');
end;

// Потому что лямбды не работают в finalization
procedure MakeSureToExit;
begin
if
(Logger.main is ConsoleLogger) and
('[REDIRECTIOMODE]' not in System.Environment.GetCommandLineArgs.Skip(1).Take(1))
then ReadString(#10'Press Enter to exit:');
FinishedPause;
StartBgThread(()->
begin
Sleep(5000);
Console.Error.WriteLine($'WARNING: {GetRelativePath(GetEXEFileName)} needed force halt because of some lingering non-background threads');
if Logger.main is ConsoleLogger then ReadString('Press Enter to Halt:');
Halt;
FinishedPause;
Halt(1);
end);
end;

Expand Down
4 changes: 2 additions & 2 deletions Utils/CLArgs.pas
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
unit CLArgs;

function GetArgs(key: string) := CommandLineArgs
.Where(arg->arg.StartsWith(key+'='))
.Select(arg->arg.SubString(key.Length+1));
.Where(arg->arg.StartsWith(key+'='))
.Select(arg->arg.SubString(key.Length+1));

end.

0 comments on commit 9eb6739

Please sign in to comment.