source: CMT/v1r19/source/cmt_project.h @ 8

Last change on this file since 8 was 8, checked in by arnault, 19 years ago

Add release conflict detection - CL 255

File size: 3.4 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// See the complete license in cmt_license.txt "http://www.cecill.info".
5//-----------------------------------------------------------
6
7#ifndef __cmt_project_h__
8#define __cmt_project_h__
9
10#include "cmt_parser.h"
11#include "cmt_system.h"
12#include "cmt_awk.h"
13
14class Project;
15
16class ProjectFactory : public IProjectFactory
17{
18public:
19  static IProjectFactory& instance ();
20
21public:
22  void reset ();
23  void create_project (const cmt_string& path,
24                       const cmt_string& path_source);
25
26private:
27  Project* m_first;
28  Project* m_previous;
29  int m_id;
30};
31
32class IProjectAction
33{
34public:
35  virtual bool run (const Project& project) = 0;
36};
37
38class Project
39{
40public:
41
42  typedef cmt_vector<Project> ProjectVector;
43
44  static void create (const cmt_string& name);
45
46  static Project* find_by_name (const cmt_string& name);
47  static Project* find_by_cmtpath (const cmt_string& cmtpath);
48  static Project* get_current ();
49  static Project* add (const cmt_string& name,
50                       const cmt_string& release);
51
52  static ProjectVector& projects ();
53  static void clear_all ();
54  static void show_all ();
55  static void show_paths ();
56  static const cmt_string& get_project_file_name ();
57
58  static void fill_selection (int depth, CmtSystem::cmt_string_vector& path_selections);
59
60  static void broadcast (IProjectAction& action);
61  static void reverse_broadcast (IProjectAction& action);
62  static void scan_paths (PathScanner& scanner, PathScanner::actor& actor);
63  static void scan_paths_for_package (PathScanner& scanner, const cmt_string& name);
64
65  static cmt_string find_in_cmt_paths (const cmt_string& path);
66
67  static void set_cmtpaths (cmt_string& buffer);
68
69public:
70
71  Project ();
72
73  const cmt_string& get_name () const;
74  const cmt_string& get_release () const;
75  const cmt_string& get_cmtpath () const;
76  const cmt_string& get_cmtpath_pwd () const;
77  const cmt_string& get_cmtpath_source () const;
78  void set_name (const cmt_string& name);
79  void set_release (const cmt_string& release);
80  void set_cmtpath (const cmt_string& path);
81  void set_cmtpath_pwd (const cmt_string& path);
82  void set_cmtpath_source (const cmt_string& source);
83  void set_predecessor (Project* predecessor);
84  void set_reference (Project* reference);
85  void clear ();
86  void configure ();
87
88  void use_action (const cmt_string& name, const cmt_string& release);
89
90  Project& operator = (const Project& other);
91  bool operator == (const cmt_string& name) const;
92  bool operator != (const cmt_string& name) const;
93
94  void show () const;
95  void show_strategies () const;
96  int get_build_strategy () const;
97  int get_setup_strategy () const;
98  void set_build_strategy (int mask, int strategy);
99  void set_setup_strategy (int mask, int strategy);
100
101private:
102  cmt_string m_name;
103  cmt_string m_release;
104
105  Project* m_reference;
106  Project* m_predecessor;
107
108  cmt_string m_cmtpath;
109  cmt_string m_cmtpath_pwd;
110  cmt_string m_cmtpath_source;
111
112  int m_build_strategy_mask;
113  int m_build_strategy;
114  int m_setup_strategy_mask;
115  int m_setup_strategy;
116
117  bool m_configured;
118
119  Tag* m_prototypes_tag;
120  Tag* m_no_prototypes_tag;
121  Tag* m_with_installarea_tag;
122  Tag* m_without_installarea_tag;
123
124  Tag* m_setup_config_tag;
125  Tag* m_setup_no_config_tag;
126  Tag* m_setup_root_tag;
127  Tag* m_setup_no_root_tag;
128  Tag* m_setup_cleanup_tag;
129  Tag* m_setup_no_cleanup_tag;
130
131};
132
133
134#endif
Note: See TracBrowser for help on using the repository browser.