KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_special_execute.h File Reference
#include <map>
#include <vector>
#include <kicommon.h>
#include <jobs/job.h>

Go to the source code of this file.

Classes

class  JOB_SPECIAL_EXECUTE
 

Macros

#define OUTPUT_TMP_PATH_VAR_NAME   wxT( "JOBSET_OUTPUT_WORK_PATH" )
 
#define EXEC_PYTHON_VAR_NAME   wxT( "KICAD_PYTHON" )
 
#define EXEC_PROJECT_PCB_VAR_NAME   wxT( "KICAD_PROJECT_PCB" )
 
#define EXEC_PROJECT_SCH_VAR_NAME   wxT( "KICAD_PROJECT_SCH" )
 

Functions

KICOMMON_API wxString FindBundledPython (const std::vector< wxString > &aToolDirs)
 Find the interpreter shipped with KiCad in the given tool directories.
 
KICOMMON_API std::map< wxString, wxString > GetExecuteBuiltinVariables (const PROJECT *aProject)
 Return the variables an Execute Command job can use beyond the environment and project variables.
 
KICOMMON_API std::map< wxString, wxString > GetExecuteBuiltinVariableHelp ()
 Describe each variable returned by GetExecuteBuiltinVariables() for the user.
 
KICOMMON_API wxString ExpandExecuteCommand (const wxString &aCommand, const PROJECT *aProject)
 Expand an Execute Command string, including the built-in variables.
 

Macro Definition Documentation

◆ EXEC_PROJECT_PCB_VAR_NAME

#define EXEC_PROJECT_PCB_VAR_NAME   wxT( "KICAD_PROJECT_PCB" )

◆ EXEC_PROJECT_SCH_VAR_NAME

#define EXEC_PROJECT_SCH_VAR_NAME   wxT( "KICAD_PROJECT_SCH" )

◆ EXEC_PYTHON_VAR_NAME

#define EXEC_PYTHON_VAR_NAME   wxT( "KICAD_PYTHON" )

◆ OUTPUT_TMP_PATH_VAR_NAME

Function Documentation

◆ ExpandExecuteCommand()

KICOMMON_API wxString ExpandExecuteCommand ( const wxString & aCommand,
const PROJECT * aProject )

Expand an Execute Command string, including the built-in variables.

A variable the user already defined, as an environment variable or a project text variable, wins over the built-in of the same name so a portable jobset can still be overridden on one machine.

Definition at line 168 of file job_special_execute.cpp.

References ExpandEnvVarSubstitutions(), GetExecuteBuiltinVariables(), name, and PROJECT::TextVarResolver().

Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_EXECUTECOMMAND_JOB_SETTINGS::populateEnvironReadOnlyTable(), JOBS_RUNNER::runSpecialExecute(), and DIALOG_EXECUTECOMMAND_JOB_SETTINGS::updateExpandedPreview().

◆ FindBundledPython()

KICOMMON_API wxString FindBundledPython ( const std::vector< wxString > & aToolDirs)

Find the interpreter shipped with KiCad in the given tool directories.

Returns
the full path of the first interpreter found, or an empty string when none is shipped.

Definition at line 51 of file job_special_execute.cpp.

References name.

Referenced by BOOST_AUTO_TEST_CASE(), and GetExecuteBuiltinVariables().

◆ GetExecuteBuiltinVariableHelp()

KICOMMON_API std::map< wxString, wxString > GetExecuteBuiltinVariableHelp ( )

◆ GetExecuteBuiltinVariables()

KICOMMON_API std::map< wxString, wxString > GetExecuteBuiltinVariables ( const PROJECT * aProject)

Return the variables an Execute Command job can use beyond the environment and project variables.

KICAD_PYTHON is the bundled interpreter, or the bare interpreter name when KiCad ships none. KICAD_PROJECT_PCB and KICAD_PROJECT_SCH are the project's board and top-level schematic. The schematic comes from the project file. The board is named after the project, or is the only board in the project folder.

Definition at line 131 of file job_special_execute.cpp.

References EXEC_PROJECT_PCB_VAR_NAME, EXEC_PROJECT_SCH_VAR_NAME, EXEC_PYTHON_VAR_NAME, FindBundledPython(), PATHS::GetExecutableDir(), PROJECT::GetProjectFullName(), PATHS::GetToolDirectories(), projectBoard(), and projectSchematic().

Referenced by ExpandExecuteCommand().