mirror of
https://github.com/yeslayla/godot-build-tools.git
synced 2025-12-06 17:23:28 +01:00
Logging & Godot Downloader
This commit is contained in:
56
internal/godot4.go
Normal file
56
internal/godot4.go
Normal 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, " ")
|
||||
}
|
||||
Reference in New Issue
Block a user