forked from Geoportail-Luxembourg/geoportailv3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geoportailv3.mk
178 lines (143 loc) · 5.81 KB
/
geoportailv3.mk
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
ifdef VARS_FILE
VARS_FILES += ${VARS_FILE} vars_geoportailv3.yaml
else
VARS_FILE = vars_geoportailv3.yaml
VARS_FILES += ${VARS_FILE}
endif
API_LESS_FILES = $(shell find $(PACKAGE)/static/less -type f -name '*.api.less' 2> /dev/null)
API_JS_FILES = $(shell find jsapi/src/ -type f -name '*.js')
TEMPLATE_EXCLUDE += LUX_alembic/script.py.mako node_modules
LANGUAGES = en fr de lb
CGXP = FALSE
MOBILE = FALSE
NGEO = TRUE
TILECLOUD_CHAIN = FALSE
DISABLE_BUILD_RULES += test-packages test-packages-ngeo
CONFIG_VARS += ldap
CONFIG_VARS += sqlalchemy_engines
CONFIG_VARS += proxy_wms_url
CONFIG_VARS += turbomail
CONFIG_VARS += authorized_ips
CONFIG_VARS += pag
CONFIG_VARS += exclude_theme_layer_search
CONFIG_VARS += overview_map
CONFIG_VARS += modify_notification
CONFIG_VARS += https_proxy
APACHE_VHOST ?= luxembourg-geomapfish
NGEO_LIBS_JS_FILES += node_modules/fuse.js/src/fuse.min.js
UTILITY_HELP = -e "- update-translations Synchronize the translations with Transifex" \
"\n- recreate-search-poi Recreate the ElasticSearch POI Index" \
"\n- recreate-search-layers Recreate the ElasticSearch Layers Index" \
"\n- update-search-layers Update the ElasticSearch Layers Index" \
"\n- update-tooltips Update the automatic generated tooltips fields" \
"\n- pull-translations Pull the translation" \
# Add rule that copies the font-awesome fonts to the static/build directory.
POST_RULES = .build/fonts.timestamp
SERVER_LOCALISATION_SOURCES_FILES += $(PACKAGE)/views/pag.py $(PACKAGE)/views/luxprintproxy.py
TOOLTIPS_LOCALISATION_FILES = $(addprefix $(PACKAGE)/locale/, $(addsuffix /LC_MESSAGES/$(PACKAGE)-tooltips.mo, $(LANGUAGES)))
# Add JS API target to "help" target
SECONDARY_HELP = -e ""
SECONDARY_HELP += "\n"
SECONDARY_HELP += "JS API targets:\n"
SECONDARY_HELP += "\n"
SECONDARY_HELP += "- build-api Build CSS & JS for the API.\n"
SECONDARY_HELP += "- build-js-api Build the JS API project.\n"
SECONDARY_HELP += "- build-css-api Build the CSS API project.\n"
SECONDARY_HELP += "- lint-js-api Run the linter on the JS API code.\n"
SECONDARY_HELP += "- clean-js-api Remove generated files of the JS API project.\n"
SECONDARY_HELP += "- serve-js-api Start a development server for the JS API project."
include CONST_Makefile
build-server: template-generate compile-py-catalog $(SERVER_LOCALISATION_FILES) $(CLIENT_LOCALISATION_FILES) $(TOOLTIPS_LOCALISATION_FILES)
# targets related to the JS API
API_OUTPUT_DIR = $(OUTPUT_DIR)
API_DIR = jsapi
API_TOOLS_DIR = $(API_DIR)/tools
API_SRC_JS_FILES := $(shell find jsapi -type f -name '*.js')
REQUIREMENTS += "suds>=0.4"
REQUIREMENTS += "ipaddr==2.1.11"
REQUIREMENTS += "pyocclient==0.2"
# DEV_REQUIREMENTS += git+https://github.com/transifex/transifex-client.git@fix-proxies#egg=transifex-client-proxies
# DEV_REQUIREMENTS += git+https://github.com/petzlux/transifex-client.git
PRINT_VERSION = NONE
.PHONY: update-translations
update-translations: $(PACKAGE)/locale/$(PACKAGE)-server.pot $(PACKAGE)/locale/$(PACKAGE)-client.pot $(PACKAGE)/locale/$(PACKAGE)-tooltips.pot
$(VENV_BIN)/tx push -s
$(VENV_BIN)/tx pull -f
.PHONY: pull-translations
pull-translations:
$(VENV_BIN)/tx pull -f
.build/fonts.timestamp: .build/node_modules.timestamp
mkdir -p $(PACKAGE)/static/build/fonts
cp node_modules/font-awesome/fonts/* $(PACKAGE)/static/build/fonts/
touch $@
.PHONY: update-search-layers
update-search-layers:
$(VENV_BIN)/layers2es --interfaces desktop --no-themes --no-blocks --no-folders
.PHONY: recreate-search-layers
recreate-search-layers:
$(VENV_BIN)/layers2es --interfaces desktop --no-themes --no-blocks --no-folders --recreate-index
.PHONY: recreate-search-poi
recreate-search-poi:
$(VENV_BIN)/db2es --reset --index
update-tooltips:
$(VENV_BIN)/tooltips2pot
.PHONY: $(PACKAGE)/locale/$(PACKAGE)-tooltips.pot
$(PACKAGE)/locale/$(PACKAGE)-tooltips.pot:
mkdir -p $(dir $@)
$(VENV_BIN)/tooltips2pot
msguniq $@ -o $@
.PHONY: build-api
build-api: \
lint-js-api \
build-js-api \
build-css-api \
build-js-apidoc
# Add new dependency to build target
build: build-api
.PHONY: build-js-api
build-js-api: \
$(API_OUTPUT_DIR)/apiv3.js
.PHONY: build-css-api
build-css-api: \
$(API_OUTPUT_DIR)/apiv3.css
$(API_OUTPUT_DIR)/apiv3.css: $(API_LESS_FILES) .build/node_modules.timestamp
mkdir -p $(dir $@)
./node_modules/.bin/lessc --clean-css $(PACKAGE)/static/less/$(PACKAGE).api.less $@
$(API_OUTPUT_DIR)/apiv3.js: $(API_DIR)/config.json \
$(API_SRC_JS_FILES) \
.build/node_modules.timestamp
mkdir -p $(dir $@)
node node_modules/openlayers/tasks/build.js $< $@
cat node_modules/proj4/dist/proj4.js node_modules/whatwg-fetch/fetch.js node_modules/d3/build/d3.min.js \
node_modules/js-autocomplete/auto-complete.min.js \
node_modules/promise-polyfill/promise.min.js \
$@ > concatenated.js
mv concatenated.js $@
.build/jsdocOl3.js: jsapi/jsdoc/get-ol3-doc-ref.js
node $< > [email protected]
mv [email protected] $@
.PHONY: build-js-apidoc
build-js-apidoc: node_modules/openlayers/config/jsdoc/api/index.md \
jsapi/jsdoc/api/conf.json $(API_SRC_JS_FILES) \
$(shell find node_modules/openlayers/config/jsdoc/api/template -type f) \
.build/node_modules.timestamp \
.build/jsdocOl3.js \
jsapi/examples/index.html
@mkdir -p $(@D)
@rm -rf $(API_OUTPUT_DIR)/apidoc
node_modules/.bin/jsdoc jsapi/jsdoc/api/index.md -c jsapi/jsdoc/api/conf.json -d $(API_OUTPUT_DIR)/apidoc
cp -rf jsapi/examples $(API_OUTPUT_DIR)/apidoc
.PHONY: serve-js-api
serve-js-api: .build/node_modules.timestamp
node $(API_TOOLS_DIR)/serve.js
.PHONY: lint-js-api
lint-js-api: ./node_modules/.bin/eslint .build/node_modules.timestamp .build/api.eslint.timestamp
.build/api.eslint.timestamp: $(API_JS_FILES)
mkdir -p $(dir $@)
./node_modules/.bin/eslint $(filter-out .build/node_modules.timestamp, $?)
touch $@
# Add new dependency to clean target
clean: clean-js-api
.PHONY: clean-js-api
clean-js-api:
rm -rf $(API_OUTPUT_DIR)/apiv3.*