SEBRAUC/Makefile

36 lines
828 B
Makefile
Raw Normal View History

2021-11-21 23:29:37 +01:00
SRC_DIR=./src
UI_DIR=./ui
2021-12-18 00:37:52 +01:00
APIDOC_FILE=./src/server/swagger/swagger.yaml
VER=$(or ${VERSION},$(shell git tag --sort=-version:refname | head -n 1))
2021-11-21 23:29:37 +01:00
setup:
cd ${UI_DIR} && pnpm install
test:
go test -v ./src/...
2021-12-18 00:05:57 +01:00
lint:
golangci-lint run
cd ${UI_DIR} && npm run format && npm run lint
2021-11-21 23:29:37 +01:00
build-ui:
cd ${UI_DIR} && pnpm run build
2021-11-21 23:29:37 +01:00
build-server:
go build -tags prod -ldflags "-s -w -X code.thetadev.de/TSGRain/SEBRAUC/src/util.version=${VER}" -o build/sebrauc ./src/.
2021-11-21 23:29:37 +01:00
build: build-ui build-server
2021-11-21 23:37:24 +01:00
2021-12-18 00:05:57 +01:00
generate-apidoc:
2021-12-18 00:37:52 +01:00
SWAGGER_GENERATE_EXTENSION=false swagger generate spec --scan-models -o ${APIDOC_FILE}
2021-12-18 00:05:57 +01:00
generate-apiclient:
2021-12-18 00:37:52 +01:00
openapi-generator generate -i ${APIDOC_FILE} -g typescript-axios -o ${UI_DIR}/src/sebrauc-client -p "supportsES6=true"
2021-12-18 00:05:57 +01:00
cd ${UI_DIR} && npm run format
2021-11-21 23:37:24 +01:00
clean:
rm -f build/*
rm -rf ${UI_DIR}/dist/**