Added windows build support
This commit is contained in:
54
utils.go
54
utils.go
@@ -71,33 +71,67 @@ func CleanUnrealProject(project Project) {
|
||||
}
|
||||
|
||||
func GenerateUnrealSolution(project Project) {
|
||||
var buildCmd string
|
||||
var cmd *exec.Cmd
|
||||
|
||||
projectFile := project.ProjectPath + "/" + project.ProjectName + ".uproject"
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
buildCmd = project.EnginePath + "/Engine/Build/BatchFiles/Linux/GenerateProjectFiles.sh"
|
||||
buildCmd := project.EnginePath + "/Engine/Build/BatchFiles/Linux/GenerateProjectFiles.sh"
|
||||
cmd = exec.Command(buildCmd, projectFile, "-game")
|
||||
|
||||
case "darwin":
|
||||
buildCmd = project.EnginePath + "/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh"
|
||||
buildCmd := project.EnginePath + "/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh"
|
||||
cmd = exec.Command(buildCmd, projectFile, "-game")
|
||||
|
||||
case "windows":
|
||||
editor := project.EnginePath + "\\Engine\\Binaries\\Win64\\UnrealEditor.exe"
|
||||
cmd = exec.Command(
|
||||
editor,
|
||||
projectFile,
|
||||
"-projectfiles",
|
||||
"-progress",
|
||||
"-waitmutex",
|
||||
"-NoHotReloadFromIDE",
|
||||
)
|
||||
|
||||
default:
|
||||
fmt.Println("Generate Project is not yet supported on Windows")
|
||||
fmt.Println("Generate Project is not supported on this platform:", runtime.GOOS)
|
||||
return
|
||||
}
|
||||
|
||||
projectCmd := project.ProjectPath + "/" + project.ProjectName + ".uproject"
|
||||
cmd := exec.Command(buildCmd, projectCmd, "-game")
|
||||
|
||||
logToOutput(cmd)
|
||||
}
|
||||
|
||||
func BuildUnrealSolution(project Project) {
|
||||
var cmd *exec.Cmd
|
||||
projectFile := project.ProjectPath + "/" + project.ProjectName + ".uproject"
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
cmd := exec.Command("make", "-C", project.ProjectPath, project.ProjectName)
|
||||
logToOutput(cmd)
|
||||
cmd = exec.Command("make", "-C", project.ProjectPath, project.ProjectName)
|
||||
|
||||
case "windows":
|
||||
buildBatch := project.EnginePath + "\\Engine\\Build\\BatchFiles\\Build.bat"
|
||||
target := project.ProjectName + "Editor"
|
||||
platform := "Win64"
|
||||
config := "Development"
|
||||
|
||||
cmd = exec.Command(
|
||||
buildBatch,
|
||||
target,
|
||||
platform,
|
||||
config,
|
||||
"-Project="+projectFile,
|
||||
"-WaitMutex",
|
||||
)
|
||||
|
||||
default:
|
||||
fmt.Println("Build Project is not yet supported on Windows")
|
||||
fmt.Println("Build Project is not yet supported on this platform:", runtime.GOOS)
|
||||
return
|
||||
}
|
||||
|
||||
logToOutput(cmd)
|
||||
}
|
||||
|
||||
func RunUnrealProject(project Project) {
|
||||
|
||||
Reference in New Issue
Block a user