• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2024 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef OHOS_COMPONENTS_MAPPING_H_
6 #define OHOS_COMPONENTS_MAPPING_H_
7 
8 #include "gn/build_settings.h"
9 #include "gn/config.h"
10 #include "gn/functions.h"
11 #include "gn/parse_tree.h"
12 #include "gn/settings.h"
13 #include "gn/substitution_writer.h"
14 #include "gn/target.h"
15 #include "gn/value.h"
16 
17 class OhosComponentMapping {
18 public:
Init(const std::string & build_dir)19     static void Init(const std::string& build_dir)
20     {
21         if (instance_ != nullptr) {
22             return;
23         }
24         instance_ = new OhosComponentMapping(build_dir);
25     }
26 
27     const std::string MappingTargetAbsoluteDpes(const BuildSettings *settings,
28         const std::string &label, const std::string &deps) const;
29     const std::string MappingImportOther(const BuildSettings *settings,
30         const std::string &label, const std::string &deps) const;
31 
getInstance()32     static OhosComponentMapping *getInstance()
33     {
34         return instance_;
35     }
36 
37 private:
38     std::string build_dir_;
39     static OhosComponentMapping *instance_;
OhosComponentMapping()40     OhosComponentMapping() {}
41     OhosComponentMapping(const std::string &build_dir);
42     OhosComponentMapping &operator = (const OhosComponentMapping &) = delete;
43 };
44 
45 #endif // OHOS_COMPONENTS_MAPPING_H_
46