[2] | 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_generators_h__ |
---|
| 8 | #define __cmt_generators_h__ |
---|
| 9 | |
---|
| 10 | #include "cmt_constituent.h" |
---|
| 11 | #include "cmt_fragment.h" |
---|
| 12 | #include "cmt_generator.h" |
---|
| 13 | |
---|
| 14 | class AnyDocumentGenerator : public CmtGenerator |
---|
| 15 | { |
---|
| 16 | public: |
---|
| 17 | AnyDocumentGenerator (); |
---|
| 18 | |
---|
| 19 | protected: |
---|
| 20 | void reset (); |
---|
| 21 | |
---|
| 22 | Variable m_TITLE; |
---|
[197] | 23 | Variable m_STRUCTURED_OUTPUT; |
---|
[2] | 24 | |
---|
| 25 | FragmentHandle make_header_fragment; |
---|
| 26 | FragmentHandle cleanup_header_fragment; |
---|
| 27 | FragmentHandle cleanup_fragment; |
---|
| 28 | FragmentHandle dependencies_fragment; |
---|
| 29 | FragmentHandle dependencies_and_triggers_fragment; |
---|
| 30 | }; |
---|
| 31 | |
---|
| 32 | class DocumentGenerator : public AnyDocumentGenerator |
---|
| 33 | { |
---|
| 34 | public: |
---|
| 35 | DocumentGenerator (); |
---|
| 36 | void build (const cmt_string& package, |
---|
| 37 | const Constituent& constituent); |
---|
| 38 | |
---|
| 39 | private: |
---|
| 40 | void reset (); |
---|
| 41 | bool analyze_file (const cmt_string& file, |
---|
| 42 | const cmt_string& constituent_name, |
---|
| 43 | const cmt_string& output_suffix); |
---|
| 44 | |
---|
| 45 | FragmentHandle document_header_fragment; |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | class LibraryGenerator : public AnyDocumentGenerator |
---|
| 49 | { |
---|
| 50 | public: |
---|
| 51 | LibraryGenerator (); |
---|
| 52 | void build (const cmt_string& package, |
---|
| 53 | const Constituent& constituent); |
---|
| 54 | |
---|
| 55 | protected: |
---|
| 56 | void reset (); |
---|
| 57 | bool analyze_file (const Constituent& constituent, |
---|
| 58 | const cmt_string& file); |
---|
| 59 | void java_file_action (SourceFile& file, const Constituent& constituent); |
---|
| 60 | void proto_file_action (const cmt_string& file, const Constituent& constituent); |
---|
| 61 | void prepare_proto_file (const cmt_string& file); |
---|
| 62 | void module_file_action (SourceFile& file, const Constituent& constituent); |
---|
| 63 | |
---|
| 64 | FragmentHandle library_header_fragment; |
---|
| 65 | FragmentHandle application_header_fragment; |
---|
| 66 | FragmentHandle java_header_fragment; |
---|
| 67 | FragmentHandle jar_header_fragment; |
---|
| 68 | FragmentHandle library_fragment; |
---|
| 69 | FragmentHandle library_no_share_fragment; |
---|
| 70 | FragmentHandle application_fragment; |
---|
| 71 | FragmentHandle jar_fragment; |
---|
| 72 | FragmentHandle java_fragment; |
---|
| 73 | FragmentHandle java_copy_fragment; |
---|
| 74 | FragmentHandle cleanup_library_fragment; |
---|
| 75 | FragmentHandle cleanup_application_fragment; |
---|
| 76 | FragmentHandle cleanup_java_fragment; |
---|
| 77 | FragmentHandle cleanup_objects_fragment; |
---|
| 78 | FragmentHandle buildproto_fragment; |
---|
| 79 | FragmentHandle check_application_fragment; |
---|
| 80 | FragmentHandle check_java_fragment; |
---|
| 81 | FragmentHandle protos_header_fragment; |
---|
| 82 | }; |
---|
| 83 | |
---|
| 84 | class ApplicationGenerator : public LibraryGenerator |
---|
| 85 | { |
---|
| 86 | public: |
---|
| 87 | }; |
---|
| 88 | |
---|
| 89 | class ReadmeGenerator : public CmtGenerator |
---|
| 90 | { |
---|
| 91 | public: |
---|
| 92 | ReadmeGenerator (); |
---|
| 93 | void build (const CmtSystem::cmt_string_vector& arguments); |
---|
| 94 | |
---|
| 95 | private: |
---|
| 96 | void reset (); |
---|
| 97 | |
---|
| 98 | FragmentHandle readme_header_fragment; |
---|
| 99 | FragmentHandle readme_fragment; |
---|
| 100 | FragmentHandle readme_doc_fragment; |
---|
| 101 | FragmentHandle readme_use_fragment; |
---|
| 102 | FragmentHandle readme_trailer_fragment; |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | class PrototypeGenerator : public CmtGenerator |
---|
| 106 | { |
---|
| 107 | public: |
---|
| 108 | void build (const cmt_string& file_name); |
---|
| 109 | }; |
---|
| 110 | |
---|
| 111 | class DefaultMakefileGenerator : public CmtGenerator |
---|
| 112 | { |
---|
| 113 | public: |
---|
| 114 | void build (); |
---|
| 115 | }; |
---|
| 116 | |
---|
| 117 | class MSDEVGenerator : public CmtGenerator |
---|
| 118 | { |
---|
| 119 | public: |
---|
| 120 | MSDEVGenerator (); |
---|
| 121 | int build_workspace (const Constituent::ConstituentVector& constituents); |
---|
| 122 | int build_project (const Constituent& constituent); |
---|
| 123 | |
---|
| 124 | private: |
---|
| 125 | void reset (); |
---|
| 126 | |
---|
| 127 | cmt_string msdevdir; |
---|
| 128 | |
---|
| 129 | FragmentHandle dsw_header_fragment; |
---|
| 130 | FragmentHandle dsw_project_fragment; |
---|
| 131 | FragmentHandle dsw_all_project_header_fragment; |
---|
| 132 | FragmentHandle dsw_all_project_dependency_fragment; |
---|
| 133 | FragmentHandle dsw_all_project_trailer_fragment; |
---|
| 134 | FragmentHandle dsw_trailer_fragment; |
---|
| 135 | |
---|
| 136 | FragmentHandle dsp_all_fragment; |
---|
| 137 | FragmentHandle dsp_library_header_fragment; |
---|
| 138 | FragmentHandle dsp_application_header_fragment; |
---|
| 139 | FragmentHandle dsp_windows_header_fragment; |
---|
| 140 | FragmentHandle dsp_contents_fragment; |
---|
| 141 | FragmentHandle dsp_trailer_fragment; |
---|
| 142 | |
---|
| 143 | }; |
---|
| 144 | |
---|
| 145 | class VSNETGenerator : public CmtGenerator |
---|
| 146 | { |
---|
| 147 | public: |
---|
| 148 | VSNETGenerator (); |
---|
| 149 | int build_workspace (const Constituent::ConstituentVector& constituents); |
---|
| 150 | int build_project (const Constituent& constituent); |
---|
| 151 | |
---|
| 152 | private: |
---|
| 153 | void reset (); |
---|
| 154 | |
---|
| 155 | void pseudoGUID (const cmt_string& a, |
---|
| 156 | const cmt_string& b, |
---|
| 157 | const cmt_string& c, |
---|
| 158 | cmt_string& d); |
---|
| 159 | |
---|
| 160 | cmt_string vsnetdir; |
---|
| 161 | |
---|
| 162 | //Visual Studio.net Support |
---|
| 163 | FragmentHandle sln_header_fragment; |
---|
| 164 | FragmentHandle sln_project_fragment; |
---|
| 165 | FragmentHandle sln_dependency_header_fragment; |
---|
| 166 | FragmentHandle sln_dependency_project_fragment; |
---|
| 167 | FragmentHandle sln_dependency_trailer_fragment; |
---|
| 168 | FragmentHandle sln_project_config_fragment; |
---|
| 169 | FragmentHandle sln_trailer_fragment; |
---|
| 170 | |
---|
| 171 | FragmentHandle vcproj_all_fragment; |
---|
| 172 | FragmentHandle vcproj_library_header_fragment; |
---|
| 173 | FragmentHandle vcproj_application_header_fragment; |
---|
| 174 | FragmentHandle vcproj_windows_header_fragment; |
---|
| 175 | FragmentHandle vcproj_contents_fragment; |
---|
| 176 | FragmentHandle vcproj_directory_header_fragment; |
---|
| 177 | FragmentHandle vcproj_directory_trailer_fragment; |
---|
| 178 | FragmentHandle vcproj_trailer_fragment; |
---|
| 179 | }; |
---|
| 180 | |
---|
| 181 | class MakeSetupGenerator : public CmtGenerator |
---|
| 182 | { |
---|
| 183 | public: |
---|
| 184 | MakeSetupGenerator (); |
---|
| 185 | void build (const cmt_string& package); |
---|
| 186 | |
---|
| 187 | private: |
---|
| 188 | void reset (); |
---|
| 189 | |
---|
| 190 | FragmentHandle make_setup_header_fragment; |
---|
| 191 | FragmentHandle make_setup_fragment; |
---|
| 192 | }; |
---|
| 193 | |
---|
| 194 | class ConstituentsMakefileGenerator : public CmtGenerator |
---|
| 195 | { |
---|
| 196 | public: |
---|
| 197 | ConstituentsMakefileGenerator (); |
---|
| 198 | void build (const cmt_string& package, |
---|
| 199 | const CmtSystem::cmt_string_vector& arguments); |
---|
| 200 | |
---|
| 201 | private: |
---|
| 202 | void reset (); |
---|
| 203 | |
---|
| 204 | FragmentHandle constituents_header_fragment; |
---|
| 205 | FragmentHandle constituents_trailer_fragment; |
---|
| 206 | FragmentHandle group_fragment; |
---|
| 207 | FragmentHandle constituent_fragment; |
---|
| 208 | FragmentHandle check_application_header_fragment; |
---|
| 209 | }; |
---|
| 210 | |
---|
| 211 | class DependencyGenerator : public CmtGenerator |
---|
| 212 | { |
---|
| 213 | public: |
---|
| 214 | void build (const CmtSystem::cmt_string_vector& arguments); |
---|
| 215 | |
---|
| 216 | private: |
---|
| 217 | void add_line_to_text (const cmt_string& line, cmt_string& text); |
---|
| 218 | cmt_string build (const cmt_string& file_name); |
---|
| 219 | bool m_stamps; |
---|
| 220 | }; |
---|
| 221 | |
---|
| 222 | #endif |
---|