summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-07-27 20:05:42 +0200
committerGitHub <noreply@github.com>2020-07-27 14:05:42 -0400
commite67c042511f859029f141a94d30824a4522898b9 (patch)
tree72635d38589893796ef11c65966562c362955d45 /Makefile
parentbfb25e4be17ba33f17156aeb7c326d80e46855ac (diff)
downloadgitea-e67c042511f859029f141a94d30824a4522898b9.tar.gz
gitea-e67c042511f859029f141a94d30824a4522898b9.zip
Add 'watch-backend' (#12330)
* Add 'watch-backend' This leverages `air` to watch the backend files and trigger `make backend` automatically when they change. It seems to work rather well together with `watch-frontend`. Fixes: https://github.com/go-gitea/gitea/issues/12318 * rework docs to a new section for continuous build Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3ab86245c5..b1acbe2295 100644
--- a/Makefile
+++ b/Makefile
@@ -106,6 +106,8 @@ BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
SVG_DEST_DIR := public/img/svg
+AIR_TMP_DIR := .air
+
TAGS ?=
TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS))
TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
@@ -161,6 +163,7 @@ help:
@echo " - lint-frontend lint frontend files"
@echo " - lint-backend lint backend files"
@echo " - watch-frontend watch frontend files and continuously rebuild"
+ @echo " - watch-backend watch backend files and continuously rebuild"
@echo " - webpack build webpack files"
@echo " - svg build svg files"
@echo " - fomantic build fomantic files"
@@ -306,6 +309,13 @@ watch-frontend: node-check $(FOMANTIC_DEST) node_modules
rm -rf $(WEBPACK_DEST_ENTRIES)
NODE_ENV=development npx webpack --hide-modules --display-entrypoints=false --watch --progress
+.PHONY: watch-backend
+watch-backend: go-check
+ @hash air > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+ GO111MODULE=off $(GO) get -u github.com/cosmtrek/air; \
+ fi
+ air -c .air.conf
+
.PHONY: test
test:
$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' $(GO_PACKAGES)
@@ -579,7 +589,7 @@ release-compress: | $(DIST_DIRS)
.PHONY: release-sources
release-sources: | $(DIST_DIRS) node_modules
echo $(VERSION) > $(STORED_VERSION_FILE)
- tar --exclude=./$(DIST) --exclude=./.git --exclude=./$(MAKE_EVIDENCE_DIR) --exclude=./node_modules/.cache -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
+ tar --exclude=./$(DIST) --exclude=./.git --exclude=./$(MAKE_EVIDENCE_DIR) --exclude=./node_modules/.cache --exclude=./$(AIR_TMP_DIR) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
rm -f $(STORED_VERSION_FILE)
.PHONY: release-docs