2019-07-28 03:19:54 +00:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
SEPARATOR := &&
|
|
|
|
SET := set
|
|
|
|
endif
|
|
|
|
|
2019-02-09 12:30:49 +00:00
|
|
|
build:
|
2019-08-21 04:07:25 +00:00
|
|
|
$(eval DATE := $(shell go run scripts/getDate.go))
|
2019-10-16 22:46:16 +00:00
|
|
|
$(eval GITHASH := $(shell git rev-parse --short HEAD))
|
2019-08-21 04:07:25 +00:00
|
|
|
$(SET) CGO_ENABLED=1 $(SEPARATOR) go build -mod=vendor -v -ldflags "-X 'github.com/stashapp/stash/pkg/api.buildstamp=$(DATE)' -X 'github.com/stashapp/stash/pkg/api.githash=$(GITHASH)'"
|
2019-02-10 12:16:29 +00:00
|
|
|
|
|
|
|
install:
|
|
|
|
packr2 install
|
|
|
|
|
2019-07-27 19:49:35 +00:00
|
|
|
clean:
|
|
|
|
packr2 clean
|
|
|
|
|
2019-02-14 20:06:37 +00:00
|
|
|
# Regenerates GraphQL files
|
2019-07-11 16:57:50 +00:00
|
|
|
.PHONY: generate
|
|
|
|
generate:
|
2019-11-16 16:03:28 +00:00
|
|
|
go generate -mod=vendor
|
2019-08-01 01:46:33 +00:00
|
|
|
cd ui/v2 && yarn run gqlgen
|
2019-02-14 20:06:37 +00:00
|
|
|
|
|
|
|
# Runs gofmt -w on the project's source code, modifying any files that do not match its style.
|
|
|
|
.PHONY: fmt
|
|
|
|
fmt:
|
2019-07-28 03:54:27 +00:00
|
|
|
go fmt ./...
|
2019-02-14 20:06:37 +00:00
|
|
|
|
|
|
|
# Runs go vet on the project's source code.
|
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
2019-11-16 16:03:28 +00:00
|
|
|
go vet -mod=vendor ./...
|
2019-02-14 20:06:37 +00:00
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
2019-02-14 22:53:32 +00:00
|
|
|
revive -config revive.toml -exclude ./vendor/... ./...
|
2019-07-28 03:19:54 +00:00
|
|
|
|
|
|
|
.PHONY: ui
|
|
|
|
ui:
|
|
|
|
cd ui/v2 && yarn build
|
2019-08-21 04:07:25 +00:00
|
|
|
packr2
|