MCPcopy Create free account
hub / github.com/KDE/kdevelop / CustomBuildJob

Method CustomBuildJob

plugins/custom-buildsystem/custombuildjob.cpp:25–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace KDevelop;
24
25CustomBuildJob::CustomBuildJob( CustomBuildSystem* plugin, KDevelop::ProjectBaseItem* item, CustomBuildSystemTool::ActionType t )
26 : OutputJob( plugin )
27 , type( t )
28 , exec(nullptr)
29 , killed( false )
30 , enabled( false )
31{
32 setCapabilities( Killable );
33 QString subgrpname;
34 switch( type ) {
35 case CustomBuildSystemTool::Build:
36 subgrpname = ConfigConstants::toolGroupPrefix() + QLatin1String("Build");
37 break;
38 case CustomBuildSystemTool::Clean:
39 subgrpname = ConfigConstants::toolGroupPrefix() + QLatin1String("Clean");
40 break;
41 case CustomBuildSystemTool::Install:
42 subgrpname = ConfigConstants::toolGroupPrefix() + QLatin1String("Install");
43 break;
44 case CustomBuildSystemTool::Configure:
45 subgrpname = ConfigConstants::toolGroupPrefix() + QLatin1String("Configure");
46 break;
47 case CustomBuildSystemTool::Prune:
48 subgrpname = ConfigConstants::toolGroupPrefix() + QLatin1String("Prune");
49 break;
50 case CustomBuildSystemTool::Undefined:
51 return;
52 }
53 projectName = item->project()->name();
54 builddir = plugin->buildDirectory( item ).toLocalFile();
55 KConfigGroup g = plugin->configuration( item->project() );
56 if(g.isValid()) {
57 KConfigGroup grp = g.group( subgrpname );
58 enabled = grp.readEntry(ConfigConstants::toolEnabled(), false);
59 cmd = grp.readEntry(ConfigConstants::toolExecutable(), QUrl()).toLocalFile();
60 environment = grp.readEntry(ConfigConstants::toolEnvironment(), QString());
61 arguments = grp.readEntry(ConfigConstants::toolArguments(), QString());
62 }
63
64 QString title;
65 switch (type) {
66 case CustomBuildSystemTool::Build:
67 title = i18nc("Building: <command> <project item name>", "Building: %1 %2", cmd, item->text());
68 break;
69 case CustomBuildSystemTool::Clean:
70 title = i18nc("Cleaning: <command> <project item name>", "Cleaning: %1 %2", cmd, item->text());
71 break;
72 case CustomBuildSystemTool::Install:
73 title = installPrefix.isEmpty() ? i18nc("Installing: <command> <project item name>", "Installing: %1 %2", cmd, item->text())
74 : i18nc("Installing: <command> <project item name> <installPrefix>", "Installing: %1 %2 %3", cmd, item->text(), installPrefix.toDisplayString(QUrl::PreferLocalFile));
75 break;
76 case CustomBuildSystemTool::Configure:
77 title = i18nc("Configuring: <command> <project item name>", "Configuring: %1 %2", cmd, item->text());
78 break;
79 case CustomBuildSystemTool::Prune:
80 title = i18nc("Pruning: <command> <project item name>", "Pruning: %1 %2", cmd, item->text());
81 break;
82 default:

Callers

nothing calls this directly

Calls 15

toolGroupPrefixFunction · 0.85
toolEnabledFunction · 0.85
toolExecutableFunction · 0.85
toolEnvironmentFunction · 0.85
toolArgumentsFunction · 0.85
toLocalFileMethod · 0.80
configurationMethod · 0.80
readEntryMethod · 0.80
QStringClass · 0.70
QUrlClass · 0.50
nameMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected