44 lines
747 B
Go
44 lines
747 B
Go
//go:build mage
|
|
// +build mage
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/openimsdk/gomake/mageutil"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
var Default = Build
|
|
|
|
func Build() {
|
|
platforms := os.Getenv("PLATFORMS")
|
|
if platforms == "" {
|
|
platforms = mageutil.DetectPlatform()
|
|
}
|
|
|
|
for _, platform := range strings.Split(platforms, " ") {
|
|
mageutil.CompileForPlatform(platform)
|
|
}
|
|
|
|
mageutil.PrintGreen("All binaries under cmd and tools were successfully compiled.")
|
|
}
|
|
|
|
func Start() {
|
|
mageutil.InitForSSC()
|
|
err := setMaxOpenFiles()
|
|
if err != nil {
|
|
mageutil.PrintRed("setMaxOpenFiles failed " + err.Error())
|
|
os.Exit(1)
|
|
}
|
|
mageutil.StartToolsAndServices()
|
|
}
|
|
|
|
func Stop() {
|
|
mageutil.StopAndCheckBinaries()
|
|
}
|
|
|
|
func Check() {
|
|
mageutil.CheckAndReportBinariesStatus()
|
|
}
|