-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·61 lines (47 loc) · 2.56 KB
/
Makefile
File metadata and controls
executable file
·61 lines (47 loc) · 2.56 KB
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
ZIP_NAME ?= "customDataTypeGfbio.zip"
PLUGIN_NAME = "custom-data-type-gfbio"
# coffescript-files to compile
COFFEE_FILES = GFBIOUtilities.coffee \
CustomDataTypeGFBIO.coffee \
CustomDataTypeGFBIOFacet.coffee \
CustomDataTypeGFBIOTreeview.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 buildinfojson ## 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 src/webfrontend/*.coffee src/tmp
cd src/tmp && coffee -b --compile ${COFFEE_FILES} # bare-parameter is obligatory!
cat src/tmp/CustomDataTypeGFBIO.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeGfbio.js
cat src/tmp/CustomDataTypeGFBIOFacet.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeGfbio.js
cat src/tmp/CustomDataTypeGFBIOTreeview.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeGfbio.js
cat src/tmp/GFBIOUtilities.js >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeGfbio.js
cp src/updater/GFBIOUpdater.js build/$(PLUGIN_NAME)/updater/GfbioUpdater.js # build updater
cat src/tmp/GFBIOUtilities.js >> build/$(PLUGIN_NAME)/updater/GfbioUpdater.js
cp package.json build/$(PLUGIN_NAME)/package.json
cp -r node_modules build/$(PLUGIN_NAME)/
rm -rf src/tmp # clean tmp
cp l10n/customDataTypeGfbio.csv build/$(PLUGIN_NAME)/l10n/customDataTypeGfbio.csv # copy l10n
cp src/webfrontend/css/main.css build/$(PLUGIN_NAME)/webfrontend/customDataTypeGfbio.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)/
buildinfojson:
repo=`git remote get-url origin | sed -e 's/\.git$$//' -e 's#.*[/\\]##'` ;\
rev=`git show --no-patch --format=%H` ;\
lastchanged=`git show --no-patch --format=%ad --date=format:%Y-%m-%dT%T%z` ;\
builddate=`date +"%Y-%m-%dT%T%z"` ;\
echo '{' > build-info.json ;\
echo ' "repository": "'$$repo'",' >> build-info.json ;\
echo ' "rev": "'$$rev'",' >> build-info.json ;\
echo ' "lastchanged": "'$$lastchanged'",' >> build-info.json ;\
echo ' "builddate": "'$$builddate'"' >> build-info.json ;\
echo '}' >> build-info.json