You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
747 B
44 lines
747 B
4 months ago
|
//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()
|
||
|
}
|