Merge pull request #900 from keymanapp/developer-message-on-compile-before-debug-762

[Developer] The debugger should check that build succeeded before attempting to start.
This commit is contained in:
Marc Durdin 2018-05-26 08:12:58 +07:00 committed by GitHub
commit bfcf8c69b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -564,6 +564,7 @@ uses
kmxfile,
OnlineConstants,
Project,
ProjectFileUI,
RegExpr,
ErrorControlledRegistry,
RedistFiles,
@ -989,6 +990,9 @@ procedure TfrmKeymanWizard.StartDebugging(FStartTest: Boolean);
ki: TKeyboardInfo;
buf: WideString;
begin
if not FileExists((ProjectFile as TkmnProjectFile).TargetFilename) then
Exit(False);
try
GetKeyboardInfo((ProjectFile as TkmnProjectFile).TargetFilename, True, ki); // I4695
try
@ -1038,7 +1042,20 @@ begin
FDebugForm.CanDebug := True;
FDebugForm.UIStatus := duiReadyForInput;
(ProjectFileUI as TkmnProjectFileUI).Debug := True; // I4687
modActionsKeyboardEditor.actKeyboardCompile.Execute;
frmMessages.Clear; // I4686
if not (ProjectFileUI as TkmnProjectFileUI).DoAction(pfaCompile, False) then
begin
ShowMessage(SKErrorsInCompile);
Exit;
end;
if not FileExists((ProjectFile as TkmnProjectFile).TargetFilename) then
begin
ShowMessage(SKKeyboardKMXDoesNotExist);
Exit;
end;
if not KeyboardContainsDebugInformation then
begin

View file

@ -21,6 +21,8 @@ interface
const
SKMustIncludeDebug = 'You must include debug information to start the debugger. Check ''Include debug information'' in the Keyboard menu.';
SKErrorsInCompile = 'The keyboard did not compile successfully. Unable to start debugger.';
SKKeyboardKMXDoesNotExist = 'The keyboard .kmx output file does not exist. The keyboard must target Windows or macOS for interactive debugging.';
implementation