1 #ifndef PROJECT_TREE_BULDER__MSVC_MASTERPROJECT_GENERATOR_HPP
2 #define PROJECT_TREE_BULDER__MSVC_MASTERPROJECT_GENERATOR_HPP
3 
4 /* $Id: msvc_masterproject_generator.hpp 122761 2008-03-25 16:45:09Z gouriano $
5  * ===========================================================================
6  *
7  *                            PUBLIC DOMAIN NOTICE
8  *               National Center for Biotechnology Information
9  *
10  *  This software/database is a "United States Government Work" under the
11  *  terms of the United States Copyright Act.  It was written as part of
12  *  the author's official duties as a United States Government employee and
13  *  thus cannot be copyrighted.  This software/database is freely available
14  *  to the public for use. The National Library of Medicine and the U.S.
15  *  Government have not placed any restriction on its use or reproduction.
16  *
17  *  Although all reasonable efforts have been taken to ensure the accuracy
18  *  and reliability of the software and data, the NLM and the U.S.
19  *  Government do not and cannot warrant the performance or results that
20  *  may be obtained by using this software or data. The NLM and the U.S.
21  *  Government disclaim all warranties, express or implied, including
22  *  warranties of performance, merchantability or fitness for any particular
23  *  purpose.
24  *
25  *  Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author:  Viatcheslav Gorelenkov
30  *
31  */
32 
33 #include "proj_item.hpp"
34 #include "proj_tree.hpp"
35 #include "msvc_prj_utils.hpp"
36 
37 #include <corelib/ncbienv.hpp>
38 BEGIN_NCBI_SCOPE
39 
40 #if NCBI_COMPILER_MSVC
41 USING_SCOPE(objects);
42 
43 /////////////////////////////////////////////////////////////////////////////
44 ///
45 /// CMsvcMasterProjectGenerator --
46 ///
47 /// Generator of _MasterProject for MSVC 7.10 solution.
48 ///
49 /// Generates utility project from the project tree. Projects hierarchy in the
50 /// project tree will be represented as folders hierarchy in _MasterProject.
51 /// Every project will be represented as a file <projectname>.bulid with
52 /// attached custom build command that allows to build this project.
53 
54 class CMsvcMasterProjectGenerator
55 {
56 public:
57     CMsvcMasterProjectGenerator(const CProjectItemsTree& tree,
58                                 const list<SConfigInfo>& configs,
59                                 const string&            project_dir);
60 
61     ~CMsvcMasterProjectGenerator(void);
62 
63     void SaveProject();
64 
65     string GetPath() const;
GetVisualStudioProject(void) const66     const CVisualStudioProject& GetVisualStudioProject(void) const
67     {
68         return m_Xmlprj;
69     }
70 
71 private:
72     CVisualStudioProject m_Xmlprj;
73     const CProjectItemsTree& m_Tree;
74     list<SConfigInfo> m_Configs;
75 
76 
77   	const string m_Name;
78 
79     const string m_ProjectDir;
80 
81     const string m_ProjectItemExt;
82 
83     string m_CustomBuildCommand;
84 
85     const string m_FilesSubdir;
86 
87 
88 
89     void AddProjectToFilter(CRef<CFilter>& filter, const CProjKey& project_id);
90 
91     void CreateProjectFileItem(const CProjKey& project_id);
92 
93     void ProcessTreeFolder(const SProjectTreeFolder&  folder,
94                            CSerialObject*             parent);
95 
96     /// Prohibited to:
97     CMsvcMasterProjectGenerator(void);
98     CMsvcMasterProjectGenerator(const CMsvcMasterProjectGenerator&);
99     CMsvcMasterProjectGenerator& operator=
100         (const CMsvcMasterProjectGenerator&);
101 
102 };
103 #endif //NCBI_COMPILER_MSVC
104 
105 END_NCBI_SCOPE
106 
107 #endif  //PROJECT_TREE_BULDER__MSVC_MASTERPROJECT_GENERATOR_HPP
108