Skip to content

Commit 47a50b4

Browse files
committed
add build info to Makefile
1 parent 0be2dbf commit 47a50b4

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build-info.json
2+
build
3+
node-modules

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ help:
2525

2626
all: build ## build all
2727

28-
build: clean ## clean, compile, copy files to build folder
28+
build: clean buildinfojson ## clean, compile, copy files to build folder
2929

3030
mkdir -p build
3131
mkdir -p build/$(PLUGIN_NAME)
3232
mkdir -p build/$(PLUGIN_NAME)/webfrontend
3333
mkdir -p build/$(PLUGIN_NAME)/l10n
3434

35+
cp build-info.json build/$(PLUGIN_NAME)/build-info.json # build-info
36+
3537
cp src/webfrontend/css/main.css build/$(PLUGIN_NAME)/webfrontend/customDataTypeGeoref.css # copy css
3638
cat $(CSS_FILE) $(CSSGEOCODER) $(CSSGLDRAW) $(CSSADDITIONAL) >> build/$(PLUGIN_NAME)/webfrontend/customDataTypeGeoref.css
3739

@@ -56,4 +58,16 @@ clean: ## clean
5658
rm -rf build
5759

5860
zip: build ## build zip file
59-
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/
61+
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/
62+
63+
buildinfojson:
64+
repo=`git remote get-url origin | sed -e 's/\.git$$//' -e 's#.*[/\\]##'` ;\
65+
rev=`git show --no-patch --format=%H` ;\
66+
lastchanged=`git show --no-patch --format=%ad --date=format:%Y-%m-%dT%T%z` ;\
67+
builddate=`date +"%Y-%m-%dT%T%z"` ;\
68+
echo '{' > build-info.json ;\
69+
echo ' "repository": "'$$repo'",' >> build-info.json ;\
70+
echo ' "rev": "'$$rev'",' >> build-info.json ;\
71+
echo ' "lastchanged": "'$$lastchanged'",' >> build-info.json ;\
72+
echo ' "builddate": "'$$builddate'"' >> build-info.json ;\
73+
echo '}' >> build-info.json

0 commit comments

Comments
 (0)