This commit is contained in:
parent
9f65c60600
commit
3fd8facbdb
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
SMAIL_VERSION ?= $(shell git describe --tags --always --dirty)
|
||||
GIT_HASH ?= $(shell git show -s --format=%H)
|
||||
BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
GO_VERSION ?= $(shell go version)
|
||||
GO_VERSION ?= $(shell cd backend && go version)
|
||||
BUILD_LDFLAGS = -s -w -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.Version=$(SMAIL_VERSION)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GitHash=$(GIT_HASH)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.BuildTime=$(BUILD_TIME)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GoVersion=$(GO_VERSION)'
|
||||
|
||||
.PHONY: build clean clean_codex_test_artifacts build_fe build_server wechat_push spam_block telegram_push plugin package test test_mysql test_postgres
|
||||
|
||||
@ -11,6 +11,7 @@ const read = relative => readFile(path.join(root, relative), 'utf8')
|
||||
|
||||
test('跨平台构建输出不得越过项目 out 目录', async () => {
|
||||
const content = await read('Makefile')
|
||||
assert.match(content, /GO_VERSION \?= \$\(shell cd backend && go version\)/)
|
||||
const commands = [...content.matchAll(/cd ([^\s]+) && [^\n]*go build [^\n]* -o ([^\s]+) /g)]
|
||||
assert.equal(commands.length, 12)
|
||||
for (const [, directory, output] of commands) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user