1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef JAVADEBUGGER_H
6#define JAVADEBUGGER_H
7
8
9#include <QObject>
10
11class JavaDebuggerPrivate;
12class JavaDebugger : public QObject
13{
14 Q_OBJECT
15public:
16 explicit JavaDebugger(QObject *parent = nullptr);
17 virtual ~JavaDebugger() override;
18
19signals:
20 void sigResolveClassPath(const QString &mainClass,
21 const QString &projectName);
22 void sigCheckInfo();
23 void sigSendToClient(const QString &uuid,
24 int port,
25 const QString &kit,
26 QMap<QString, QVariant> &param);
27
28public slots:
29 void slotReceivePojectInfo(const QString &uuid,
30 const QString &kit,
31 const QString &workspace,
32 const QString &configHomePath,
33 const QString &jrePath,
34 const QString &jreExecute,
35 const QString &launchPackageFile,
36 const QString &launchConfigPath,
37 const QString &dapPackageFile,
38 const QString &projectCachePath);
39 void slotResolveClassPath(const QString &mainClass,
40 const QString &projectName);
41 void slotCheckInfo();
42
43private:
44 void registerLaunchDAPConnect();
45
46 void initialize(const QString &configHomePath,
47 const QString &jreExecute,
48 const QString &launchPackageFile,
49 const QString &launchConfigPath,
50 const QString &workspace);
51 void executeCommand(const QString &command);
52 void parseResult(const QString &content);
53 bool parseMainClass(const QString &content, QString &mainClass, QString &projectName);
54 bool parseClassPath(const QString &content, QStringList &classPaths);
55 void outputMsg(const QString &title, const QString &msg);
56
57 JavaDebuggerPrivate *const d;
58};
59
60#endif // JAVADEBUGGER_H
61