projects.py: Move bulk of code into module

Move nearly all of projects.py into src/python/jw/build/App.py. The
plan is to split the script into parts and import them.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-15 11:08:52 +01:00
commit aa3e2efd84
10 changed files with 1033 additions and 1012 deletions

View file

@ -131,7 +131,7 @@ EDITOR ?= xdg-open
ifeq ($(TIME),)
TIME = $(shell which time) -p
endif
PROJECTS_PY = python3 $(JWB_SCRIPT_DIR)/projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS)
PROJECTS_PY = PYTHONPATH=$(realpath $(JWBDIR)/src/python) $(TIME) python3 $(JWB_SCRIPT_DIR)/projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS)
PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS)
PGIT_SH = /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh
PURGE_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/purge-stale-projects.sh $(JW_BUILD_BINDIR)/purge-stale-projects.sh) purge-not-found)
@ -154,7 +154,7 @@ CVS_PROJECTS = $(patsubst %/,%,$(dir $(wildcard $(addsuffix /CVS
# --- mandatory targets
all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
$(TIME) $(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS)
$(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS)
clean: clean-dirs
distclean: clean-all-dirs done.clean
install:

View file

@ -30,7 +30,7 @@ endif
include $(JWBDIR)/make/py-version.mk
ifneq ($(TOPDIR),)
proj_query_cmd = $(PYTHON) $(JWB_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS)
proj_query_cmd = PYTHONPATH=$(JWBDIR)/src/python $(PYTHON) $(JWB_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS)
proj_query = $(shell $(proj_query_cmd) $(1))
proj_dir = $(call proj_query,proj-dir $(1))
htdocs_dir = $(call proj_query,htdocs-dir $(1))

File diff suppressed because it is too large Load diff

4
src/Makefile Normal file
View file

@ -0,0 +1,4 @@
TOPDIR = ..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/dirs.mk

4
src/python/Makefile Normal file
View file

@ -0,0 +1,4 @@
TOPDIR = ../..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/py-mods.mk

4
src/python/jw/Makefile Normal file
View file

@ -0,0 +1,4 @@
TOPDIR = ../../..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/dirs.mk

1012
src/python/jw/build/App.py Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
TOPDIR = ../../../..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/py-mod.mk

View file

View file