Browse Source

修改调试问题;使用magefile代替makefile

gitlink
Sydonian 2 years ago
parent
commit
5e73665ef3
2 changed files with 22 additions and 15 deletions
  1. +0
    -15
      Makefile
  2. +22
    -0
      magefiles/magefile.go

+ 0
- 15
Makefile View File

@@ -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}

+ 22
- 0
magefiles/magefile.go View File

@@ -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,
})
}

Loading…
Cancel
Save