github.com/openimsdk/tools@v0.0.49/utils/mageutil/usage-guide/magefile.go (about)

     1  //go:build mage
     2  // +build mage
     3  
     4  package main
     5  
     6  import (
     7  	"github.com/openimsdk/tools/utils/mageutil"
     8  	"os"
     9  	"strings"
    10  )
    11  
    12  var Default = Build
    13  
    14  func Build() {
    15  	platforms := os.Getenv("PLATFORMS")
    16  	if platforms == "" {
    17  		platforms = mageutil.DetectPlatform()
    18  	}
    19  
    20  	for _, platform := range strings.Split(platforms, " ") {
    21  		mageutil.CompileForPlatform(platform)
    22  	}
    23  
    24  	mageutil.PrintGreen("All binaries under cmd and tools were successfully compiled.")
    25  }
    26  
    27  func Start() {
    28  	setMaxOpenFiles()
    29  	mageutil.StartToolsAndServices()
    30  }
    31  
    32  func Stop() {
    33  	mageutil.StopAndCheckBinaries()
    34  }
    35  
    36  func Check() {
    37  	mageutil.CheckAndReportBinariesStatus()
    38  }