-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·54 lines (40 loc) · 2.16 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
ZIP_NAME ?= "customDataTypeFinto.zip"
PLUGIN_NAME = "custom-data-type-finto"
# coffescript-files to compile
COFFEE_FILES = commons.coffee \
FINTOUtilities.coffee \
CustomDataTypeFINTO.coffee \
CustomDataTypeFINTOFacet.coffee \
CustomDataTypeFINTOTreeview.coffee
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
all: build ## build all
build: clean ## clean, compile, copy files to build folder
npm install --save node-fetch # install needed node-module
mkdir -p build
mkdir -p build/$(PLUGIN_NAME)
mkdir -p build/$(PLUGIN_NAME)/webfrontend
mkdir -p build/$(PLUGIN_NAME)/updater
mkdir -p build/$(PLUGIN_NAME)/l10n
mkdir -p src/tmp # build code from coffee
cp easydb-library/src/commons.coffee src/tmp
cp src/webfrontend/*.coffee src/tmp
cd src/tmp && coffee -b --compile ${COFFEE_FILES} # bare-parameter is obligatory!
# first: commons! Important
cat src/tmp/commons.js > build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.js
cat src/tmp/CustomDataTypeFINTO.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.js
cat src/tmp/CustomDataTypeFINTOFacet.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.js
cat src/tmp/CustomDataTypeFINTOTreeview.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.js
cat src/tmp/FINTOUtilities.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.js
cp src/updater/FINTOUpdater.js build/$(PLUGIN_NAME)/updater/FintoUpdater.js # build updater
cat src/tmp/FINTOUtilities.js >> build/$(PLUGIN_NAME)/updater/FintoUpdater.js
cp package.json build/$(PLUGIN_NAME)/package.json
cp -r node_modules build/$(PLUGIN_NAME)/
rm -rf src/tmp # clean tmp
cp l10n/customDataTypeFinto.csv build/$(PLUGIN_NAME)/l10n/customDataTypeFinto.csv # copy l10n
cp src/webfrontend/css/main.css build/$(PLUGIN_NAME)/webfrontend/customDataTypeFinto.css # copy css
cp manifest.master.yml build/$(PLUGIN_NAME)/manifest.yml # copy manifest
clean: ## clean
rm -rf build
zip: build ## build zip file
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/