forked from openimsdk/chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magefile.go
43 lines (34 loc) · 747 Bytes
/
magefile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//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()
}