diff options
author | zeripath <art27@cantab.net> | 2020-01-27 01:05:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-27 01:05:38 +0000 |
commit | 48abe41ea82f88235bd6a6a66f6a2d1701215b84 (patch) | |
tree | c4b42644f047f3f09314acd034f283f3804d2f68 /Makefile | |
parent | d087f4fb735d860a394baf709f4cac5b945f9287 (diff) | |
download | gitea-48abe41ea82f88235bd6a6a66f6a2d1701215b84.tar.gz gitea-48abe41ea82f88235bd6a6a66f6a2d1701215b84.zip |
Generate Bindata iff TAGS="bindata" and not up-to-date (#10004)
* Only generate bindata if necessary
* Only generate bindata if they are not up-to-date
* generate a hash of the fileinfo and use that to keep up-to-date
* Newer test is redundant
* handle missing bindata and clean
* Only update hash after successful write
* switch to sha1 hash
* Apply suggestions from code review
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -52,6 +52,7 @@ CSS_SOURCES ?= $(shell find web_src/less -type f) JS_DEST := public/js/index.js CSS_DEST := public/css/index.css BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go +BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST)) JS_DEST_DIR := public/js CSS_DEST_DIR := public/css @@ -145,7 +146,7 @@ clean-all: clean .PHONY: clean clean: $(GO) clean -i ./... - rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) \ + rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \ integrations*.test \ integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-mysql8/ integrations/gitea-integration-sqlite/ \ integrations/gitea-integration-mssql/ integrations/indexers-mysql/ integrations/indexers-mysql8/ integrations/indexers-pgsql integrations/indexers-sqlite \ @@ -161,7 +162,7 @@ vet: .PHONY: generate generate: fomantic js css - GO111MODULE=on $(GO) generate -mod=vendor $(PACKAGES) + GO111MODULE=on $(GO) generate -mod=vendor -tags '$(TAGS)' $(PACKAGES) .PHONY: generate-swagger generate-swagger: |