-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
fx_definition.h
56 lines (46 loc) · 1.89 KB
/
fx_definition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __FX_DEFINITION_H__
#define __FX_DEFINITION_H__
#include "pal.h"
#include "deps_format.h"
#include "runtime_config.h"
class fx_definition_t
{
public:
fx_definition_t();
fx_definition_t(
const pal::string_t& name,
const pal::string_t& dir,
const pal::string_t& requested_version,
const pal::string_t& found_version);
const pal::string_t& get_name() const { return m_name; }
const pal::string_t& get_requested_version() const { return m_requested_version; }
const pal::string_t& get_found_version() const { return m_found_version; }
const pal::string_t& get_dir() const { return m_dir; }
const runtime_config_t& get_runtime_config() const { return m_runtime_config; }
void parse_runtime_config(const pal::string_t& path, const pal::string_t& dev_path, const runtime_config_t::settings_t& override_settings);
const pal::string_t& get_deps_file() const { return m_deps_file; }
void set_deps_file(const pal::string_t value) { m_deps_file = value; }
const deps_json_t& get_deps() const { return m_deps; }
void parse_deps();
void parse_deps(const deps_json_t::rid_fallback_graph_t& graph);
private:
pal::string_t m_name;
pal::string_t m_dir;
pal::string_t m_requested_version;
pal::string_t m_found_version;
runtime_config_t m_runtime_config;
pal::string_t m_deps_file;
deps_json_t m_deps;
};
typedef std::vector<std::unique_ptr<fx_definition_t>> fx_definition_vector_t;
static const fx_definition_t& get_root_framework(const fx_definition_vector_t& fx_definitions)
{
return *fx_definitions[fx_definitions.size() - 1];
}
static const fx_definition_t& get_app(const fx_definition_vector_t& fx_definitions)
{
return *fx_definitions[0];
}
#endif // __FX_DEFINITION_H__