compilation

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultPlatformConfig

func GetDefaultPlatformConfig(platform string) platforms.PlatformConfig

GetDefaultPlatformConfig obtains a PlatformConfig from the default generator for the provided platform.

func GetSupportedCompilationPlatforms

func GetSupportedCompilationPlatforms() []string

GetSupportedCompilationPlatforms obtains a list of strings which represent platform identifiers supported by methods in this package.

func IsSupportedCompilationPlatform

func IsSupportedCompilationPlatform(platform string) bool

IsSupportedCompilationPlatform returns a boolean status indicating if a platform identifier is supported within this package.

Types

type CompilationConfig

type CompilationConfig struct {
	// Platform references an identifier indicating which compilation platform to use.
	// PlatformConfig is a structure dependent on the defined Platform.
	Platform string `json:"platform"`

	// PlatformConfig describes the Platform-specific configuration needed to compile.
	PlatformConfig *json.RawMessage `json:"platformConfig"`
}

CompilationConfig describes the configuration options used to compile a smart contract target.

func NewCompilationConfig

func NewCompilationConfig(platform string) (*CompilationConfig, error)

NewCompilationConfig returns a CompilationConfig with default values for a given platform identifier. If an error occurs, it is returned instead.

func NewCompilationConfigFromPlatformConfig

func NewCompilationConfigFromPlatformConfig(platformConfig platforms.PlatformConfig) (*CompilationConfig, error)

NewCompilationConfigFromPlatformConfig takes a platforms.PlatformConfig and wraps it in a generic CompilationConfig. This allows many platform config types to be serialized/deserialized to their appropriate types and supported generally.

func (*CompilationConfig) Compile

func (c *CompilationConfig) Compile() ([]types.Compilation, string, error)

Compile takes a generic CompilationConfig and deserializes the inner platforms.PlatformConfig, which is then used to compile the underlying targets. Returns a list of compilations returned by the platform provider or an error. Command-line input may also be returned in either case.,

func (*CompilationConfig) GetPlatformConfig

func (c *CompilationConfig) GetPlatformConfig() (platforms.PlatformConfig, error)

GetPlatformConfig will return the de-serialized version of platforms.PlatformConfig for a given CompilationConfig

func (*CompilationConfig) SetPlatformConfig

func (c *CompilationConfig) SetPlatformConfig(platformConfig platforms.PlatformConfig) error

SetPlatformConfig replaces the current platform config with the one provided as an argument Note that non-nil platform configs will not be accepted

func (*CompilationConfig) SetTarget

func (c *CompilationConfig) SetTarget(newTarget string) error

SetTarget will update the compilation target in the underlying PlatformConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL