From 5e73665ef3e4b0a39c59dd679fdacb0112efedde Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Sun, 25 Jun 2023 15:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B0=83=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=E4=BD=BF=E7=94=A8magefile=E4=BB=A3=E6=9B=BFm?= =?UTF-8?q?akefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 15 --------------- magefiles/magefile.go | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 Makefile create mode 100644 magefiles/magefile.go diff --git a/Makefile b/Makefile deleted file mode 100644 index 7e96732..0000000 --- a/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -OUTPUT_BINARY_NAME = "client" -OUTPUT_DIR_NAME = "client" - - -ASSETS_DIR_NAME = "assets" -BUILD_DIR = "../../build" - -build: - go build -o ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME}${OUTPUT_BINARY_EXT} - @if [ -d ${ASSETS_DIR_NAME} ] && [ -n "`ls -A ${ASSETS_DIR_NAME}`" ] ;then \ - cp -r ${ASSETS_DIR_NAME}/* ${BUILD_DIR}/${OUTPUT_DIR_NAME}/; \ - fi - -clean: - rm -f ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME} \ No newline at end of file diff --git a/magefiles/magefile.go b/magefiles/magefile.go new file mode 100644 index 0000000..6d8bb5a --- /dev/null +++ b/magefiles/magefile.go @@ -0,0 +1,22 @@ +//go:build mage + +package main + +import ( + "magefiles" + "magefiles/utils" + + //mage:import + "magefiles/targets" +) + +var Default = Build + +func Build() error { + return utils.Build(magefiles.BuildArgs{ + OutputBinName: "client", + OutputDirName: "client", + AssetsDir: "assets", + PubArgs: targets.PubGoBuildArgs, + }) +}