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