2016-11-15 20:30:34 +01:00
|
|
|
// Copyright 2016 Marapongo, Inc. All rights reserved.
|
|
|
|
|
|
|
|
package compiler
|
|
|
|
|
|
|
|
import (
|
2016-11-18 21:40:15 +01:00
|
|
|
"github.com/marapongo/mu/pkg/compiler/backends"
|
2016-11-15 20:30:34 +01:00
|
|
|
"github.com/marapongo/mu/pkg/diag"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Options contains all of the settings a user can use to control the compiler's behavior.
|
|
|
|
type Options struct {
|
2016-11-30 00:27:02 +01:00
|
|
|
Diag diag.Sink // a sink to use for all diagnostics.
|
|
|
|
SkipCodegen bool // if true, no code-generation phases run.
|
|
|
|
Arch backends.Arch // a target cloud architecture.
|
|
|
|
Cluster string // a named cluster with predefined settings to target.
|
|
|
|
Args map[string]string // optional arguments passed at the CLI.
|
2016-11-15 20:30:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultOpts returns the default set of compiler options.
|
2016-11-16 03:00:43 +01:00
|
|
|
func DefaultOpts(pwd string) Options {
|
2016-11-15 20:30:34 +01:00
|
|
|
return Options{
|
2016-11-16 03:00:43 +01:00
|
|
|
Diag: diag.DefaultSink(pwd),
|
2016-11-15 20:30:34 +01:00
|
|
|
}
|
|
|
|
}
|