mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-26 07:08:11 +00:00
feat: remove ui completely
This commit is contained in:
43
magefile.go
43
magefile.go
@@ -27,9 +27,9 @@ var (
|
||||
goarch = envOr("GOARCH", runtime.GOARCH)
|
||||
)
|
||||
|
||||
// Build builds both olcrtc CLI and UI binaries.
|
||||
// Build builds the olcrtc CLI binary.
|
||||
func Build() error {
|
||||
mg.Deps(BuildCLI, BuildUI)
|
||||
mg.Deps(BuildCLI)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -39,11 +39,6 @@ func BuildCLI() error {
|
||||
return buildBinary("olcrtc", "./cmd/olcrtc", goos, goarch)
|
||||
}
|
||||
|
||||
// BuildUI builds the Fyne desktop UI binary.
|
||||
func BuildUI() error {
|
||||
return buildUIBinary(goos, goarch)
|
||||
}
|
||||
|
||||
// Cross builds olcrtc for all supported platforms.
|
||||
func Cross() error {
|
||||
mg.Deps(Deps)
|
||||
@@ -153,40 +148,6 @@ func buildBinary(name, pkg, os_, arch string) error {
|
||||
return sh.RunWithV(env, goexe, args...)
|
||||
}
|
||||
|
||||
func buildUIBinary(os_, arch string) error {
|
||||
if err := ensureBuildDir(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ext := ""
|
||||
if os_ == "windows" {
|
||||
ext = ".exe"
|
||||
}
|
||||
outName := fmt.Sprintf("%s-%s-%s%s", "olcrtc-ui", os_, arch, ext)
|
||||
absOut, err := filepath.Abs(filepath.Join(buildDir, outName))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("building olcrtc-ui (%s/%s)\n", os_, arch)
|
||||
|
||||
cmd := exec.Command(goexe, "build",
|
||||
"-trimpath",
|
||||
"-ldflags", ldflags,
|
||||
"-o", absOut,
|
||||
".",
|
||||
)
|
||||
cmd.Dir = "ui"
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Env = append(os.Environ(),
|
||||
"GOOS="+os_,
|
||||
"GOARCH="+arch,
|
||||
)
|
||||
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func ensureBuildDir() error {
|
||||
return os.MkdirAll(buildDir, 0o755)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user