This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
forked from plone/plone.app.mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (71 loc) · 2.97 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
BUILDOUT_BIN ?= $(shell command -v buildout || echo 'bin/buildout')
BUILDOUT_ARGS ?=
SHELL = /usr/bin/env bash
export PATH := $(PATH):node_modules/.bin
STATIC = src/plone/app/mosaic/browser/static
SOURCE_JS = build.js $(shell find $(STATIC)/js -name "*.js")
BUNDLE_JS = $(STATIC)/plone-mosaic.js
SOURCE_LESS = $(shell find $(STATIC)/css -name "*.less")
BUNDLE_LESS = $(STATIC)/plone-mosaic.css
BUNDLE_GRID_LESS = $(STATIC)/mosaic-grid.css
BUNDLE_STYLES_LESS = $(STATIC)/mosaic-styles.css
CURRENT_DIR = $(shell pwd)
LESS_OPTS = --modify-var=staticPath="$(CURRENT_DIR)" \
--modify-var=bootstrapPath="$(CURRENT_DIR)/components/bootstrap" \
--modify-var=barcelonetaPath="$(CURRENT_DIR)/components/plonetheme.barceloneta/plonetheme/barceloneta/theme" \
--modify-var=plone-toolbar-draft-color="rgb(250,184,42)" \
--modify-var=plone-toolbar-pending-color="rgb(226,231,33)" \
--modify-var=plone-toolbar-private-color="rgb(196,24,60)" \
--modify-var=plone-toolbar-internal-color="rgb(250,184,42)" \
--modify-var=plone-toolbar-internally-published-color="rgb(136,61,250)" \
--verbose
RJS_OPTIONS = paths.pat-logger=$(CURRENT_DIR)/components/patternslib/src/core/logger paths.logging=$(CURRENT_DIR)/components/logging/src/logging
# if mode variable is empty, setting debug build mode
ifeq ($(mode),release)
RJS_ARGS = -o build.js generateSourceMaps=false preserveLicenseComments=true $(RJS_OPTIONS)
else
RJS_ARGS = -o build.js $(RJS_OPTIONS)
endif
all: build
build: $(BUNDLE_JS) $(BUNDLE_LESS) $(BUNDLE_GRID_LESS) $(BUNDLE_STYLES_LESS)
install:
npm install
./node_modules/bower/bin/bower install
$(BUNDLE_JS): $(SOURCE_JS)
r.js $(RJS_ARGS)
cp $(BUNDLE_JS) $(BUNDLE_JS).tmp
grep -v sourceMapping $(BUNDLE_JS).tmp > $(BUNDLE_JS)
ifeq ($(mode),release)
else
echo '' >> $(BUNDLE_JS)
grep sourceMapping $(BUNDLE_JS).tmp >> $(BUNDLE_JS)
endif
rm $(BUNDLE_JS).tmp
$(BUNDLE_LESS): $(SOURCE_LESS)
lessc $(LESS_OPTS) $(STATIC)/css/mosaic.pattern.less > $(BUNDLE_LESS)
$(BUNDLE_GRID_LESS): $(SOURCE_LESS)
lessc $(LESS_OPTS) $(STATIC)/css/mosaic.grid.less > $(BUNDLE_GRID_LESS)
$(BUNDLE_STYLES_LESS): $(SOURCE_LESS)
lessc $(LESS_OPTS) $(STATIC)/css/mosaic.styles.less > $(BUNDLE_STYLES_LESS)
watch:
watch make $(STATIC)
clean:
rm -f $(BUNDLE_JS) $(BUNDLE_JS).map $(BUNDLE_LESS) $(BUNDLE_GRID_LESS) $(BUNDLE_STYLES_LESS)
watch_instance: bin/instance
RELOAD_PATH=src bin/instance fg
watch_webpack: node_modules webpack.config.js
watch_webpack: $(wildcard resources/src/plone-mosaic/*)
webpack-dev-server || sleep 10 && webpack-dev-server
watch_theme: bin/instance
rm -rf resources/theme/plone-mosaic
make -j watch_instance watch_webpack
###
.PHONY: clean r.js
node_modules: package.json
npm install
touch node_modules
bin/buildout: requirements.txt
bin/pip install -r requirements.txt
bin/instance: $(BUILDOUT_BIN) buildout.cfg develop.cfg
$(BUILDOUT_BIN) -N $(BUILDOUT_ARGS) -c develop.cfg \
install instance plonesite