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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
use crate::Architecture;
use move_core_types::account_address::AccountAddress;
use move_symbol_pool::symbol::Symbol;
use std::{collections::BTreeMap, path::PathBuf};
pub type NamedAddress = Symbol;
pub type PackageName = Symbol;
pub type FileName = Symbol;
pub type PackageDigest = Symbol;
pub type AddressDeclarations = BTreeMap<NamedAddress, Option<AccountAddress>>;
pub type DevAddressDeclarations = BTreeMap<NamedAddress, AccountAddress>;
pub type Version = (u64, u64, u64);
pub type Dependencies = BTreeMap<PackageName, Dependency>;
pub type Substitution = BTreeMap<NamedAddress, SubstOrRename>;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct SourceManifest {
pub package: PackageInfo,
pub addresses: Option<AddressDeclarations>,
pub dev_address_assignments: Option<DevAddressDeclarations>,
pub build: Option<BuildInfo>,
pub dependencies: Dependencies,
pub dev_dependencies: Dependencies,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct PackageInfo {
pub name: PackageName,
pub version: Version,
pub authors: Vec<Symbol>,
pub license: Option<Symbol>,
pub custom_properties: BTreeMap<Symbol, String>,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Dependency {
pub local: PathBuf,
pub subst: Option<Substitution>,
pub version: Option<Version>,
pub digest: Option<PackageDigest>,
pub git_info: Option<GitInfo>,
pub node_info: Option<CustomDepInfo>,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct GitInfo {
pub git_url: Symbol,
pub git_rev: Symbol,
pub subdir: PathBuf,
pub download_to: PathBuf,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct CustomDepInfo {
pub node_url: Symbol,
pub package_address: Symbol,
pub package_name: Symbol,
pub download_to: PathBuf,
}
#[derive(Default, Debug, Clone, Eq, PartialEq)]
pub struct BuildInfo {
pub language_version: Option<Version>,
pub architecture: Option<Architecture>,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum SubstOrRename {
RenameFrom(NamedAddress),
Assign(AccountAddress),
}