summaryrefslogtreecommitdiffstats
path: root/buildtools/ant/antprojectpart.h
blob: d6540c48b97d44a8b827af52ca89e35f3eb9cd8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef _ANTPROJECTPART_H_
#define _ANTPROJECTPART_H_


#include <qstring.h>
#include <qstringlist.h>
#include <qmap.h>


class QPopupMenu;


class KAction;
class KDialogBase;
class Context;
class ClassPathWidget;


#include "kdevbuildtool.h"


class AntOptionsWidget;


class AntOptions
{
public:

  AntOptions();

  enum Verbosity { Quiet, Verbose, Debug };

  QString m_buildXML;
  QString m_defaultTarget;
  QStringList m_targets;
  QMap<QString,QString> m_properties;
  QMap<QString,bool> m_defineProperties;
  Verbosity m_verbosity;
  
};


class AntProjectPart : public KDevBuildTool
{
  Q_OBJECT

public:
	  
  AntProjectPart(QObject *parent, const char *name, const QStringList &args);
  ~AntProjectPart();
    QStringList distFiles() const;


protected:

  virtual void openProject(const QString &dirName, const QString &projectName);
  virtual void closeProject();

  virtual QString projectDirectory() const;
  virtual QString projectName() const;
  virtual QString mainProgram() const;
  virtual QString activeDirectory() const;
  virtual QStringList allFiles() const;
  virtual QString buildDirectory() const;
  virtual QString runDirectory() const;
  virtual QString runArguments() const;
  virtual QString debugArguments() const;
  virtual DomUtil::PairList runEnvironmentVars() const;

  virtual void addFile(const QString &fileName);
  virtual void addFiles ( const QStringList &fileList );
  virtual void removeFile(const QString &fileName);
  virtual void removeFiles ( const QStringList& fileList );


private slots:

  void slotBuild();
  void slotTargetMenuActivated(int id);

  void projectConfigWidget(KDialogBase *dlg);
  void contextMenu(QPopupMenu *popup, const Context *context);

  void optionsAccepted();

  void slotAddToProject();
  void slotRemoveFromProject();


private:

  void parseBuildXML();
  void fillMenu();
  void populateProject();

  void ant(const QString &target);

  QString m_projectDirectory, m_projectName;
  QStringList m_classPath;

  QStringList m_sourceFiles;

  AntOptions m_antOptions;

  KAction *m_buildProjectAction;

  QPopupMenu *m_targetMenu;

  AntOptionsWidget *m_antOptionsWidget;
  ClassPathWidget *m_classPathWidget;

  QString m_contextFileName;

};


#endif