function TApkBuilder.BuildByAnt: Boolean;
var
Tool: TIDEExternalToolOptions;
begin
Result := False;
Tool := TIDEExternalToolOptions.Create;
try
Tool.Title := 'Building APK (Ant)... ';
{$ifdef darwin}
Tool.EnvironmentOverrides.Add('JAVA_HOME=${/usr/libexec/java_home}');
{$else}
Tool.EnvironmentOverrides.Add('JAVA_HOME=' + FJdkPath);
{$endif}
Tool.WorkingDirectory := FProjPath;
Tool.Executable := IncludeTrailingPathDelimiter(FAntPath) + 'ant'{$ifdef windows}+'.bat'{$endif};
if not FileExists(Tool.Executable) then
raise Exception.CreateFmt('Ant bin (%s) not found! Check path settings', [Tool.Executable]);
Tool.CmdLineParams := 'clean -Dtouchtest.enabled=true debug';
// tk Required for Lazarus >=1.7 to capture output correctly
{$if lcl_fullversion >= 1070000}
Tool.ShowConsole := True;
{$endif}
// end tk
Tool.Scanners.Add(SubToolAnt);
if not RunExternalTool(Tool) then
raise Exception.Create('Cannot build APK!');
Result := True;
finally
Tool.Free;
end;
end;
In the xfce4 environment, the TApkBuilder.BuildByAnt code does not work correctly.
All parameters from Tool.CmdLineParams will be applied to xfce4-terminal and not to the program specified in Tool.Executable.
If string
Tool.CmdLineParams := 'clean -Dtouchtest.enabled=true debug';
to replace
Tool.CmdLineParams := '-e "'+Tool.Executable+' clean -Dtouchtest.enabled=true debug"';
then the build was successful. This is provided that there is not a single running xfce4 terminal.
I consider that it is necessary to use for assembly not the terminal of an environment, but xterm.
How can I indicate that the build will go through xterm?