1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef GRADLEPROJECTGENERATOR_H
6#define GRADLEPROJECTGENERATOR_H
7
8#include "gradleasynparse.h"
9#include "services/project/projectservice.h"
10
11#include <QObject>
12#include <QDomDocument>
13
14class GradleProjectGeneratorPrivate;
15class GradleProjectGenerator : public dpfservice::ProjectGenerator
16{
17 Q_OBJECT
18 GradleProjectGeneratorPrivate *const d;
19public:
20 explicit GradleProjectGenerator();
21 ~GradleProjectGenerator() override;
22 static QString toolKitName() { return "gradle"; }
23 virtual QStringList supportLanguages() override;
24 virtual QStringList supportFileNames() override;
25 virtual QDialog* configureWidget(const QString &language,
26 const QString &projectPath) override;
27 virtual bool configure(const dpfservice::ProjectInfo &info = {}) override;
28 virtual QStandardItem *createRootItem(const dpfservice::ProjectInfo &info) override;
29 virtual void removeRootItem(QStandardItem* root) override;
30 virtual QMenu* createItemMenu(const QStandardItem *item) override;
31
32private slots:
33 void doProjectChildsModified(const QList<QStandardItem*> &items);
34 void doGradleGeneratMenu(const QString &program, const QStringList &args, const QString &workdir);
35 void doGradleCleanMenu();
36 void doGradleTaskActionTriggered();
37 void actionProperties(const dpfservice::ProjectInfo &info, QStandardItem *item);
38
39private:
40 void restoreRuntimeCfg(dpfservice::ProjectInfo &info);
41};
42
43#endif // GRADLEPROJECTGENERATOR_H
44