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
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

use std::path::Path;

#[derive(Debug, Clone)]
pub enum CompiledPackageLayout {
    BuildInfo,
    Root,
    Sources,
    SourceMaps,
    CompiledModules,
    CompiledScripts,
    CompiledDocs,
    CompiledABIs,
}

impl CompiledPackageLayout {
    pub fn path(&self) -> &Path {
        let path = match self {
            Self::BuildInfo => "BuildInfo.yaml",
            Self::Root => "build",
            Self::Sources => "sources",
            Self::SourceMaps => "source_maps",
            Self::CompiledModules => "bytecode_modules",
            Self::CompiledScripts => "bytecode_scripts",
            Self::CompiledDocs => "docs",
            Self::CompiledABIs => "abis",
        };
        Path::new(path)
    }
}