1 #ifndef PROJECT_TREE_BUILDER__PRJ_FILE_COLLECTOR__HPP
2 #define PROJECT_TREE_BUILDER__PRJ_FILE_COLLECTOR__HPP
3 
4 /* $Id: prj_file_collector.hpp 568681 2018-08-09 14:49: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:  Andrei Gourianov
30  *
31  */
32 
33 #include "proj_item.hpp"
34 #include "msvc_project_context.hpp"
35 
36 
37 BEGIN_NCBI_SCOPE
38 
39 #if defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE)
40 
41 /////////////////////////////////////////////////////////////////////////////
42 class CProjectFileCollector
43 {
44 public:
45     CProjectFileCollector(const CProjItem& prj,
46         const list<SConfigInfo>& configs, const string& output_dir);
47     ~CProjectFileCollector(void);
48 
49     bool CheckProjectConfigs(void);
50     void DoCollect(void);
51 
GetEnabledConfigs(void) const52     const list<SConfigInfo>& GetEnabledConfigs(void) const
53     {
54         return m_EnabledConfigs;
55     }
GetProjectContext(void) const56     const CMsvcPrjProjectContext& GetProjectContext(void) const
57     {
58         return m_ProjContext;
59     }
GetSources(void) const60     const list<string>& GetSources(void) const
61     {
62         return m_Sources;
63     }
GetConfigurableSources(void) const64     const list<string>& GetConfigurableSources(void) const
65     {
66         return m_ConfigurableSources;
67     }
GetHeaders(void) const68     const list<string>& GetHeaders(void) const
69     {
70         return m_Headers;
71     }
72     bool GetIncludeDirs(list<string>& dirs, const SConfigInfo& cfg) const;
73     bool GetLibraryDirs(list<string>& dirs, const SConfigInfo& cfg) const;
GetDataSpecs(void) const74     const list<string>& GetDataSpecs(void) const
75     {
76         return m_DataSpecs;
77     }
78     string GetDataSpecImports(const string& spec) const;
79 
80     static string GetFileExtension(const string& file);
81     static bool IsProducedByDatatool(
82         const CProjItem& projitem, const string& file);
83     static bool IsInsideDatatoolSourceDir(const string& file, string& ext);
84 
85 private:
86     void CollectSources(void);
87     void CollectHeaders(void);
88     void CollectDataSpecs(void);
89 
90     const CProjItem& m_ProjItem;
91     CMsvcPrjProjectContext m_ProjContext;
92     list<SConfigInfo> m_Configs;
93     list<SConfigInfo> m_EnabledConfigs;
94     string m_OutputDir;
95     list<string> m_Sources;
96     list<string> m_ConfigurableSources;
97     list<string> m_Headers;
98     list<string> m_DataSpecs;
99 };
100 #endif
101 
102 END_NCBI_SCOPE
103 
104 #endif //PROJECT_TREE_BUILDER__PRJ_FILE_COLLECTOR__HPP
105