From be72887216c801e3b2656604c1adc102b550132f Mon Sep 17 00:00:00 2001 From: Sayan Jyoti Das Date: Thu, 28 Aug 2025 12:13:14 +0530 Subject: [PATCH] add build support for new IfcTester webapp --- src/common.mk | 4 +++- src/ifctester/Makefile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/common.mk b/src/common.mk index f7f3c7ead4..24537d06de 100644 --- a/src/common.mk +++ b/src/common.mk @@ -11,11 +11,13 @@ ifeq ($(OS),Windows_NT) PYTHON:=python PIP:=pip VENV_BIN:=Scripts -endif +else +UNAME_S:=$(shell uname -s) ifeq ($(UNAME_S),Darwin) SED:=sed -i '' -e PYTHON:=python3 endif +endif VENV_ACTIVATE:=$(VENV_BIN)/activate diff --git a/src/ifctester/Makefile b/src/ifctester/Makefile index 3597bf96e1..f05a6aa6e2 100644 --- a/src/ifctester/Makefile +++ b/src/ifctester/Makefile @@ -19,6 +19,39 @@ PACKAGE_NAME:=ifctester include ../common.mk +NODE_ENV ?= production +WEBAPP_DIR := webapp-next +WEBAPP_BUILD_DIR := $(WEBAPP_DIR)/dist + +.PHONY: webapp-dev +webapp-dev: + cd $(WEBAPP_DIR) && npm run dev + +.PHONY: webapp-build +webapp-build: + cd $(WEBAPP_DIR) && npm install + cd $(WEBAPP_DIR) && npm run build + +.PHONY: webapp-serve +webapp-serve: webapp-build + cd $(WEBAPP_DIR) && $(PYTHON) serve.py + +.PHONY: webapp-clean +webapp-clean: + rm -rf $(WEBAPP_BUILD_DIR) + rm -rf $(WEBAPP_DIR)/node_modules + +.PHONY: dist +dist: webapp-prepare + $(MAKE) -f ../common.mk dist PACKAGE_NAME=$(PACKAGE_NAME) + +.PHONY: webapp-prepare +webapp-prepare: webapp-build + rm -rf $(PACKAGE_NAME)/webapp/www/* + mkdir -p $(PACKAGE_NAME)/webapp/www + cp -r $(WEBAPP_BUILD_DIR)/* $(PACKAGE_NAME)/webapp/www/ + cp $(WEBAPP_DIR)/serve.py $(PACKAGE_NAME)/webapp/serve.py + .PHONY: test test: pytest -p no:pytest-blender test