Added build command
This commit is contained in:
parent
4f2bb677dc
commit
56bb014b51
7 changed files with 103 additions and 12 deletions
34
build/Build.go
Normal file
34
build/Build.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package build
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
// Build describes a compiler build.
|
||||
type Build struct {
|
||||
ExecutableName string
|
||||
ExecutablePath string
|
||||
WriteExecutable bool
|
||||
}
|
||||
|
||||
// New creates a new build.
|
||||
func New(directory string) (*Build, error) {
|
||||
directory, err := filepath.Abs(directory)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
executableName := filepath.Base(directory)
|
||||
|
||||
build := &Build{
|
||||
ExecutableName: executableName,
|
||||
ExecutablePath: filepath.Join(directory, executableName),
|
||||
WriteExecutable: true,
|
||||
}
|
||||
|
||||
return build, nil
|
||||
}
|
||||
|
||||
// Run parses the input files and generates an executable file.
|
||||
func (build *Build) Run() error {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue