1515
1616BINDATA := modules/{options,public,templates}/bindata.go
1717STYLESHEETS := $(wildcard public/less/index.less public/less/_* .less)
18- JAVASCRIPTS :=
1918DOCKER_TAG := gitea/gitea:latest
2019GOFILES := $(shell find . -name "* .go" -type f ! -path "./vendor/* " ! -path "* /bindata.go")
2120GOFMT ?= gofmt -s
@@ -82,7 +81,7 @@ generate-swagger:
8281 swagger generate spec -o ./public/swagger.v1.json
8382 $(SED_INPLACE ) " s;\" .ref\" : \" #/definitions/GPGKey\" ;\" type\" : \" object\" ;g" ./public/swagger.v1.json
8483 $(SED_INPLACE ) " s;^ \" .ref\" : \" #/definitions/Repository\" ; \" type\" : \" object\" ;g" ./public/swagger.v1.json
85-
84+
8685.PHONY : errcheck
8786errcheck :
8887 @hash errcheck > /dev/null 2>&1 ; if [ $$ ? -ne 0 ]; then \
@@ -261,12 +260,24 @@ javascripts: public/js/index.js
261260public/js/index.js : $(JAVASCRIPTS )
262261 cat $< > | $@
263262
263+ .PHONY : stylesheets-check
264+ stylesheets-check : stylesheets
265+ @diff=$$(git diff public/css/index.css ) ; \
266+ if [ -n " $$ diff" ]; then \
267+ echo " Please run 'make less' and commit the result:" ; \
268+ echo " $$ {diff}" ; \
269+ exit 1; \
270+ fi ;
271+
264272.PHONY : stylesheets
265273stylesheets : public/css/index.css
266274
267275.IGNORE : public/css/index.css
268276public/css/index.css : $(STYLESHEETS )
269- lessc $< $@
277+ @which lessc > /dev/null; if [ $$ ? -ne 0 ]; then \
278+ go get -u github.com/kib357/less-go/lessc; \
279+ fi
280+ lessc -i $< -o $@
270281
271282.PHONY : swagger-ui
272283swagger-ui :
@@ -276,9 +287,6 @@ swagger-ui:
276287 rm -Rf /tmp/swagger-ui
277288 $(SED_INPLACE ) " s;http://petstore.swagger.io/v2/swagger.json;../../swagger.v1.json;g" public/assets/swagger-ui/index.html
278289
279- .PHONY : assets
280- assets : javascripts stylesheets
281-
282290.PHONY : update-translations
283291update-translations :
284292 mkdir -p ./translations
@@ -287,4 +295,4 @@ update-translations:
287295 $(SED_INPLACE ) -e ' s/="/=/g' -e ' s/"$$//g' ./translations/* .ini
288296 $(SED_INPLACE ) -e ' s/\\"/"/g' ./translations/* .ini
289297 mv ./translations/* .ini ./options/locale/
290- rmdir ./translations
298+ rmdir ./translations
0 commit comments