Logging & Godot Downloader

This commit is contained in:
2023-07-23 02:30:27 -04:00
parent bc33b4805a
commit 649d0d87f9
11 changed files with 728 additions and 0 deletions

56
internal/godot4.go Normal file
View File

@@ -0,0 +1,56 @@
package internal
import "strings"
type Godot4ArgBuilder struct {
args []string
}
func NewGodot4ArgBuilder(projectDir string) GodotArgBuilder {
return &Godot4ArgBuilder{
args: []string{"--path", projectDir},
}
}
func (b *Godot4ArgBuilder) AddHeadlessFlag() {
b.args = append(b.args, "--headless")
}
func (b *Godot4ArgBuilder) AddDebugFlag() {
b.args = append(b.args, "--debug")
}
func (b *Godot4ArgBuilder) AddVerboseFlag() {
b.args = append(b.args, "--verbose")
}
func (b *Godot4ArgBuilder) AddQuietFlag() {
b.args = append(b.args, "--quiet")
}
func (b *Godot4ArgBuilder) AddDumpGDExtensionInterfaceFlag() {
b.args = append(b.args, "--dump-gdextension-interface")
}
func (b *Godot4ArgBuilder) AddDumpExtensionApiFlag() {
b.args = append(b.args, "--dump-extension-api")
}
func (b *Godot4ArgBuilder) AddCheckOnlyFlag() {
b.args = append(b.args, "--check-only")
}
func (b *Godot4ArgBuilder) AddExportFlag(exportType ExportType) {
switch exportType {
case ExportTypeRelease:
b.args = append(b.args, "--export")
case ExportTypeDebug:
b.args = append(b.args, "--export-debug")
case ExportTypePack:
b.args = append(b.args, "--export-pack")
}
}
func (b *Godot4ArgBuilder) GenerateArgs() string {
return strings.Join(b.args, " ")
}