Jan Dittberner
25b101afae
- add linter config and fix golangci-lint warnings - rename module to match new repository location - use embedded resources for static assets, templates and translations - recommend mkcert in README - require at least Go 1.19 - update and tidy dependencies - update copyright information - improve Makefile, add lint and static asset targets
38 lines
964 B
Makefile
38 lines
964 B
Makefile
GOFILES = $(shell find -type f -name '*.go')
|
|
TEMPLATES = $(wildcard ui/templates/*.gohtml)
|
|
TRANSLATIONS = $(wildcard translations/active.*.toml)
|
|
RESOURCES = ui/css ui/images ui/js
|
|
|
|
all: demo-app
|
|
|
|
ui/css: ../cacert_resources/static/css
|
|
cp -r ../cacert_resources/static/css ui/
|
|
|
|
ui/js: ../cacert_resources/static/js
|
|
cp -r ../cacert_resources/static/js ui/
|
|
|
|
ui/images: ../cacert_resources/static/images
|
|
cp -r ../cacert_resources/static/images ui/
|
|
|
|
go.sum: go.mod
|
|
go mod tidy -v
|
|
|
|
translations: $(TRANSLATIONS) $(GOFILES)
|
|
cd translations ; \
|
|
goi18n extract .. ; \
|
|
goi18n merge active.*.toml ; \
|
|
if translate.*.toml 2>/dev/null; then \
|
|
echo "missing translations"; \
|
|
goi18n merge active.*.toml translate.*.toml; \
|
|
fi
|
|
|
|
lint: $(GOFILES)
|
|
golangci-lint run --verbose
|
|
|
|
demo-app: go.sum $(GOFILES) $(TEMPLATES) translations $(RESOURCES)
|
|
CGO_ENABLED=0 go build -o $@ ./cmd/app
|
|
|
|
clean:
|
|
rm -rf demo-app ui/css ui/js ui/images
|
|
|
|
.PHONY: all translations clean lint
|