File indexing completed on 2024-04-28 04:38:24

0001 /*
0002     SPDX-FileCopyrightText: 2010 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later
0005 */
0006 
0007 #ifndef CUSTOMBUILDJOB_H
0008 #define CUSTOMBUILDJOB_H
0009 
0010 #include <outputview/outputjob.h>
0011 #include "custombuildsystemconfig.h"
0012 #include <QProcess>
0013 
0014 class CustomBuildSystem;
0015 namespace KDevelop
0016 {
0017 class ProjectBaseItem;
0018 class CommandExecutor;
0019 class OutputModel;
0020 class IProject;
0021 }
0022 
0023 class CustomBuildJob : public KDevelop::OutputJob
0024 {
0025 Q_OBJECT
0026 public:
0027     enum ErrorType {
0028         UndefinedBuildType = UserDefinedError,
0029         FailedToStart,
0030         UnknownExecError,
0031         Crashed,
0032         WrongArgs,
0033         ToolDisabled,
0034         NoCommand
0035     };
0036     
0037     CustomBuildJob( CustomBuildSystem*, KDevelop::ProjectBaseItem*, CustomBuildSystemTool::ActionType t );
0038     void start() override;
0039     bool doKill() override;
0040 
0041     void setInstallPrefix(const QUrl &installPrefix) { this->installPrefix=installPrefix; }
0042 
0043 private Q_SLOTS:
0044     void procFinished(int);
0045     void procError( QProcess::ProcessError );
0046 private:
0047     KDevelop::OutputModel* model();
0048     CustomBuildSystemTool::ActionType type;
0049     QString projectName;
0050     QString cmd;
0051     QString arguments;
0052     QString environment;
0053     QString builddir;
0054     QUrl installPrefix;
0055     KDevelop::CommandExecutor* exec;
0056     bool killed;
0057     bool enabled;
0058 };
0059 
0060 #endif