@@ -77,6 +77,7 @@ ifeq ($(RACE_ENABLED),true)
7777endif
7878
7979STORED_VERSION_FILE := VERSION
80+ HUGO_VERSION ?= 0.111.3
8081
8182ifneq ($(DRONE_TAG ) ,)
8283 VERSION ?= $(subst v,,$(DRONE_TAG))
@@ -130,7 +131,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify
130131
131132TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE ) $(FOMANTIC_WORK_DIR ) /node_modules $(DIST ) $(MAKE_EVIDENCE_DIR ) $(AIR_TMP_DIR ) $(GO_LICENSE_TMP_DIR )
132133
133- GO_DIRS := cmd tests models modules routers build services tools
134+ GO_DIRS := build cmd models modules routers services tests
134135WEB_DIRS := web_src/js web_src/css
135136
136137GO_SOURCES := $(wildcard * .go)
@@ -188,6 +189,7 @@ help:
188189 @echo " - clean delete backend and integration files"
189190 @echo " - clean-all delete backend, frontend and integration files"
190191 @echo " - deps install dependencies"
192+ @echo " - deps-docs install docs dependencies"
191193 @echo " - deps-frontend install frontend dependencies"
192194 @echo " - deps-backend install backend dependencies"
193195 @echo " - deps-tools install tool dependencies"
@@ -217,7 +219,6 @@ help:
217219 @echo " - tidy run go mod tidy"
218220 @echo " - test[\#TestSpecificName] run unit test"
219221 @echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
220- @echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
221222
222223.PHONY : go-check
223224go-check :
273274
274275.PHONY : fmt-check
275276fmt-check : fmt
276- @diff=$$(git diff $(GO_SOURCES ) templates $(WEB_DIRS ) ) ; \
277+ @diff=$$(git diff --color=always $(GO_SOURCES ) templates $(WEB_DIRS ) ) ; \
277278 if [ -n " $$ diff" ]; then \
278279 echo " Please run 'make fmt' and commit the result:" ; \
279280 echo " $$ {diff}" ; \
@@ -309,7 +310,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
309310
310311.PHONY : swagger-check
311312swagger-check : generate-swagger
312- @diff=$$(git diff '$(SWAGGER_SPEC ) ' ) ; \
313+ @diff=$$(git diff --color=always '$(SWAGGER_SPEC ) ' ) ; \
313314 if [ -n " $$ diff" ]; then \
314315 echo " Please run 'make generate-swagger' and commit the result:" ; \
315316 echo " $$ {diff}" ; \
@@ -351,7 +352,7 @@ lint-backend: golangci-lint vet editorconfig-checker
351352
352353.PHONY : watch
353354watch :
354- bash tools /watch.sh
355+ bash build /watch.sh
355356
356357.PHONY : watch-frontend
357358watch-frontend : node-check node_modules
@@ -414,7 +415,7 @@ vendor: go.mod go.sum
414415
415416.PHONY : tidy-check
416417tidy-check : tidy
417- @diff=$$(git diff go.mod go.sum $(GO_LICENSE_FILE ) ) ; \
418+ @diff=$$(git diff --color=always go.mod go.sum $(GO_LICENSE_FILE ) ) ; \
418419 if [ -n " $$ diff" ]; then \
419420 echo " Please run 'make tidy' and commit the result:" ; \
420421 echo " $$ {diff}" ; \
@@ -815,14 +816,17 @@ release-docs: | $(DIST_DIRS) docs
815816 tar -czf $(DIST ) /release/gitea-docs-$(VERSION ) .tar.gz -C ./docs/public .
816817
817818.PHONY : docs
818- docs :
819+ docs : deps-docs
820+ cd docs; make trans-copy clean build-offline;
821+
822+ .PHONY : deps-docs
823+ deps-docs :
819824 @hash hugo > /dev/null 2>&1 ; if [ $$ ? -ne 0 ]; then \
820- curl -sL https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux -64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr /bin/hugo && chmod +x /usr /bin/hugo; \
825+ curl -sL https://github.com/gohugoio/hugo/releases/download/v $( HUGO_VERSION ) /hugo_ $( HUGO_VERSION ) _Linux -64bit.tar.gz | tar zxf - -C /tmp && mkdir -p ~ /go/bin && mv /tmp/hugo ~ /go /bin/hugo && chmod +x ~ /go /bin/hugo; \
821826 fi
822- cd docs; make trans-copy clean build-offline;
823827
824828.PHONY : deps
825- deps : deps-frontend deps-backend deps-tools
829+ deps : deps-frontend deps-backend deps-tools deps-docs
826830
827831.PHONY : deps-frontend
828832deps-frontend : node_modules
@@ -885,7 +889,7 @@ svg: node-check | node_modules
885889.PHONY : svg-check
886890svg-check : svg
887891 @git add $(SVG_DEST_DIR )
888- @diff=$$(git diff --cached $(SVG_DEST_DIR ) ) ; \
892+ @diff=$$(git diff --color=always -- cached $(SVG_DEST_DIR ) ) ; \
889893 if [ -n " $$ diff" ]; then \
890894 echo " Please run 'make svg' and 'git add $( SVG_DEST_DIR) ' and commit the result:" ; \
891895 echo " $$ {diff}" ; \
@@ -895,7 +899,7 @@ svg-check: svg
895899.PHONY : lockfile-check
896900lockfile-check :
897901 npm install --package-lock-only
898- @diff=$$(git diff package-lock.json ) ; \
902+ @diff=$$(git diff --color=always package-lock.json ) ; \
899903 if [ -n " $$ diff" ]; then \
900904 echo " package-lock.json is inconsistent with package.json" ; \
901905 echo " Please run 'npm install --package-lock-only' and commit the result:" ; \
@@ -934,10 +938,6 @@ generate-manpage:
934938 @gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
935939 @# TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
936940
937- .PHONY : pr\# %
938- pr\#% : clean-all
939- $(GO ) run contrib/pr/checkout.go $*
940-
941941.PHONY : golangci-lint
942942golangci-lint :
943943 $(GO ) run $(GOLANGCI_LINT_PACKAGE ) run
0 commit comments