Skip to content

Commit be72887

Browse files
theseyanMoult
authored andcommitted
add build support for new IfcTester webapp
1 parent 5400712 commit be72887

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

src/common.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ ifeq ($(OS),Windows_NT)
1111
PYTHON:=python
1212
PIP:=pip
1313
VENV_BIN:=Scripts
14-
endif
14+
else
15+
UNAME_S:=$(shell uname -s)
1516
ifeq ($(UNAME_S),Darwin)
1617
SED:=sed -i '' -e
1718
PYTHON:=python3
1819
endif
20+
endif
1921

2022
VENV_ACTIVATE:=$(VENV_BIN)/activate
2123

src/ifctester/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@
1919
PACKAGE_NAME:=ifctester
2020
include ../common.mk
2121

22+
NODE_ENV ?= production
23+
WEBAPP_DIR := webapp-next
24+
WEBAPP_BUILD_DIR := $(WEBAPP_DIR)/dist
25+
26+
.PHONY: webapp-dev
27+
webapp-dev:
28+
cd $(WEBAPP_DIR) && npm run dev
29+
30+
.PHONY: webapp-build
31+
webapp-build:
32+
cd $(WEBAPP_DIR) && npm install
33+
cd $(WEBAPP_DIR) && npm run build
34+
35+
.PHONY: webapp-serve
36+
webapp-serve: webapp-build
37+
cd $(WEBAPP_DIR) && $(PYTHON) serve.py
38+
39+
.PHONY: webapp-clean
40+
webapp-clean:
41+
rm -rf $(WEBAPP_BUILD_DIR)
42+
rm -rf $(WEBAPP_DIR)/node_modules
43+
44+
.PHONY: dist
45+
dist: webapp-prepare
46+
$(MAKE) -f ../common.mk dist PACKAGE_NAME=$(PACKAGE_NAME)
47+
48+
.PHONY: webapp-prepare
49+
webapp-prepare: webapp-build
50+
rm -rf $(PACKAGE_NAME)/webapp/www/*
51+
mkdir -p $(PACKAGE_NAME)/webapp/www
52+
cp -r $(WEBAPP_BUILD_DIR)/* $(PACKAGE_NAME)/webapp/www/
53+
cp $(WEBAPP_DIR)/serve.py $(PACKAGE_NAME)/webapp/serve.py
54+
2255
.PHONY: test
2356
test:
2457
pytest -p no:pytest-blender test

0 commit comments

Comments
 (0)