Documentation
¶
Overview ¶
Package targetconfig implements the static configuration types supplied to the generator from a target by calling its config.ts getGeneratorConfig().
Refer to the configuration package for functionality relating to the target-specific configurations that are available to customers. Generally referred to as the "LangCfg".
Index ¶
- type CompileConfiguration
- type Configuration
- type GeneratorInitialConfiguration
- type GojaCompileConfiguration
- type GojaConfiguration
- type GojaLintConfiguration
- type GojaRunnerCommand
- type GojaRunnerCommandDependency
- type GojaRunnerCommandDependencyVersion
- type GojaRunnerConfiguration
- type GojaRunnerDependencies
- type GojaTestingConfiguration
- type LintConfiguration
- type TestingConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileConfiguration ¶
type CompileConfiguration struct {
// Dependencies and processes for running generated code compilation.
Runner *processrunner.Runner
}
Represents target-specific configuration for compiling generated code.
type Configuration ¶
type Configuration struct {
// Processes and dependencies necessary to compile the generated target
// code. If unset, the target does not implement code compilation.
Compile *CompileConfiguration
// Processes and dependencies necessary to perform static analysis of the
// generated target code. If unset, the target does not implement code
// linting.
Lint *LintConfiguration
// Configuration for target testing.
Testing *TestingConfiguration
}
Represents the target implementation configuration presented to the generator from the target.
func NewConfiguration ¶
func NewConfiguration(ctx context.Context, target types.Target, genConfig GeneratorInitialConfiguration) (*Configuration, error)
Creates a Configuration by calling into the target config.ts file getGeneratorConfig function.
type GeneratorInitialConfiguration ¶
type GeneratorInitialConfiguration struct {
// Runtime environment variables, e.g. UNITY_ROOT.
Env map[string]string
// Target-specific configuration passed by customer.
LangCfg map[string]any
// Generation output directory.
OutDir string
// Runtime platform, e.g. GOOS environment variable.
Platform string
// Enabled when the generation includes publishing.
Publish bool
// URL of the repository for the generated code.
RepoURL string
// Enabled when the generation includes testing.
Tests bool
}
Represents the initial generator configuration presented to the target to fetch the target configuration.
type GojaCompileConfiguration ¶
type GojaCompileConfiguration struct {
Runner *GojaRunnerConfiguration
}
Represents a CompileConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (*GojaCompileConfiguration) Convert ¶
func (c *GojaCompileConfiguration) Convert(ctx context.Context) (*CompileConfiguration, error)
Converts the GojaCompileConfiguration into its CompileConfiguration form for the generator.
type GojaConfiguration ¶
type GojaConfiguration struct {
Compile *GojaCompileConfiguration
Lint *GojaLintConfiguration
Testing *GojaTestingConfiguration
}
Represents the entire target configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func NewGojaConfiguration ¶
func NewGojaConfiguration(value any) (*GojaConfiguration, error)
Creates a GojaConfiguration from a (goja.Value).Export() value.
func (*GojaConfiguration) Convert ¶
func (c *GojaConfiguration) Convert(ctx context.Context) (*Configuration, error)
Converts the GojaConfiguration into its Configuration form for the generator.
type GojaLintConfiguration ¶
type GojaLintConfiguration struct {
Runner *GojaRunnerConfiguration
}
Represents a LintConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (*GojaLintConfiguration) Convert ¶
func (c *GojaLintConfiguration) Convert(ctx context.Context) (*LintConfiguration, error)
Converts the GojaLintConfiguration into its LintConfiguration form for the generator.
type GojaRunnerCommand ¶
type GojaRunnerCommand struct {
Command string
Args []string
EnvironmentVariables map[string]string
IgnoreCommandNotFound bool
StdoutDiscard bool
Parallel bool
}
Represents a processrunner.Command configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (GojaRunnerCommand) Convert ¶
func (g GojaRunnerCommand) Convert(ctx context.Context) (processrunner.Command, error)
Converts the GojaRunnerCommand into its processrunner.Command form for the generator.
type GojaRunnerCommandDependency ¶
type GojaRunnerCommandDependency struct {
Command string
InstallDocumentation string
Version *GojaRunnerCommandDependencyVersion
}
Represents a processrunner.CommandDependency configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (GojaRunnerCommandDependency) Convert ¶
func (g GojaRunnerCommandDependency) Convert(ctx context.Context) (processrunner.CommandDependency, error)
Converts the GojaRunnerCommandDependency into its processrunner.CommandDependency form for the generator.
type GojaRunnerCommandDependencyVersion ¶
Represents a processrunner.CommandVersionDependency configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (*GojaRunnerCommandDependencyVersion) Convert ¶
func (g *GojaRunnerCommandDependencyVersion) Convert(ctx context.Context) (*processrunner.CommandVersionDependency, error)
Converts the GojaRunnerCommandDependencyVersion into its processrunner.CommandVersionDependency form for the generator.
type GojaRunnerConfiguration ¶
type GojaRunnerConfiguration struct {
Commands []GojaRunnerCommand
Dependencies *GojaRunnerDependencies
}
Represents a processrunner.Runner configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (*GojaRunnerConfiguration) Convert ¶
func (g *GojaRunnerConfiguration) Convert(ctx context.Context) (*processrunner.Runner, error)
Converts the GojaRunnerConfiguration into its processrunner.Runner form for the generator.
type GojaRunnerDependencies ¶
type GojaRunnerDependencies struct {
ArgVariables map[string]string
Commands []GojaRunnerCommandDependency
EnvironmentVariables map[string]string
}
Represents a processrunner.Dependencies configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (GojaRunnerDependencies) Convert ¶
func (g GojaRunnerDependencies) Convert(ctx context.Context) (processrunner.Dependencies, error)
Converts the GojaRunnerDependencies into its processrunner.Dependencies form for the generator.
type GojaTestingConfiguration ¶
type GojaTestingConfiguration struct {
Compile *GojaCompileConfiguration
Runner *GojaRunnerConfiguration
}
Represents a TestingConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.
func (*GojaTestingConfiguration) Convert ¶
func (c *GojaTestingConfiguration) Convert(ctx context.Context) (*TestingConfiguration, error)
Converts the GojaTestingConfiguration into its TestingConfiguration form for the generator.
type LintConfiguration ¶
type LintConfiguration struct {
// Dependencies and processes for running generated code linting.
Runner *processrunner.Runner
}
Represents target-specific configuration for performing static analysis of generated code.
type TestingConfiguration ¶
type TestingConfiguration struct {
// Processes and dependencies for compiling generated target testing.
Compile *CompileConfiguration
// Processes and dependencies for running generated target testing.
Runner *processrunner.Runner
}
Represents target-specific testing configuration.
Source Files
¶
- compile_configuration.go
- configuration.go
- doc.go
- generator_initial_configuration.go
- goja_compile_configuration.go
- goja_configuration.go
- goja_lint_configuration.go
- goja_runner_command.go
- goja_runner_command_dependency.go
- goja_runner_command_version_dependency.go
- goja_runner_configuration.go
- goja_runner_dependencies.go
- goja_testing_configuration.go
- lint_configuration.go
- testing_configuration.go