summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-07-11 21:28:57 -0500
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-07-12 04:28:57 +0200
commit2b05b104ef21309c0e82e5c6c12517b22a7cd8b2 (patch)
tree810de427676889b4aff378c18cd0986b38d1e338 /Makefile
parent89845f67283f5c767daa86aa0dd970d92cbdf717 (diff)
downloadgitea-2b05b104ef21309c0e82e5c6c12517b22a7cd8b2.tar.gz
gitea-2b05b104ef21309c0e82e5c6c12517b22a7cd8b2.zip
Add verify changed less-file step to Makefile (#1861)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 15 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index bee8712b68..b3474375f6 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,6 @@ endif
BINDATA := modules/{options,public,templates}/bindata.go
STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less)
-JAVASCRIPTS :=
DOCKER_TAG := gitea/gitea:latest
GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
GOFMT ?= gofmt -s
@@ -82,7 +81,7 @@ generate-swagger:
swagger generate spec -o ./public/swagger.v1.json
$(SED_INPLACE) "s;\".ref\": \"#/definitions/GPGKey\";\"type\": \"object\";g" ./public/swagger.v1.json
$(SED_INPLACE) "s;^ \".ref\": \"#/definitions/Repository\"; \"type\": \"object\";g" ./public/swagger.v1.json
-
+
.PHONY: errcheck
errcheck:
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
@@ -261,12 +260,24 @@ javascripts: public/js/index.js
public/js/index.js: $(JAVASCRIPTS)
cat $< >| $@
+.PHONY: stylesheets-check
+stylesheets-check: stylesheets
+ @diff=$$(git diff public/css/index.css); \
+ if [ -n "$$diff" ]; then \
+ echo "Please run 'make less' and commit the result:"; \
+ echo "$${diff}"; \
+ exit 1; \
+ fi;
+
.PHONY: stylesheets
stylesheets: public/css/index.css
.IGNORE: public/css/index.css
public/css/index.css: $(STYLESHEETS)
- lessc $< $@
+ @which lessc > /dev/null; if [ $$? -ne 0 ]; then \
+ go get -u github.com/kib357/less-go/lessc; \
+ fi
+ lessc -i $< -o $@
.PHONY: swagger-ui
swagger-ui:
@@ -276,9 +287,6 @@ swagger-ui:
rm -Rf /tmp/swagger-ui
$(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../swagger.v1.json;g" public/assets/swagger-ui/index.html
-.PHONY: assets
-assets: javascripts stylesheets
-
.PHONY: update-translations
update-translations:
mkdir -p ./translations
@@ -287,4 +295,4 @@ update-translations:
$(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
mv ./translations/*.ini ./options/locale/
- rmdir ./translations \ No newline at end of file
+ rmdir ./translations