feat(bootstrap): replace exec()-based addon loading with manifest-driven loader #256
Reference in New Issue
Block a user
Delete Branch "feat/manifest-addon-loader"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the hard-coded
exec()addon loading insrc/Mod/Create/Init.pyandInitGui.pywith a manifest-driven loader that scansmods/, parsespackage.xmlmanifests, validates compatibility, resolves dependency order, and exposes a runtime addon registry.Closes #248
Changes
src/Mod/Create/addon_loader.py(new) — six-stage pipeline:mods/forpackage.xmlat depth 1-2<kindred>extensions via ElementTreemin_create_version,max_create_version) and path existencegraphlib.TopologicalSorter, with legacy fallback when no<kindred>elements existInit.py/InitGui.pyviaexec()(same mechanism, now ordered)AddonRegistryexposed asFreeCAD.KindredAddonssrc/Mod/Create/Init.py— replacedsetup_kindred_addons()withload_addons(gui=False)src/Mod/Create/InitGui.py— replacedsetup_kindred_workbenches()withload_addons(gui=True); all QTimer Silo integration code unchangedsrc/Mod/Create/CMakeLists.txt— addedaddon_loader.pyto install listBackward compatibility
Addons without
<kindred>elements in theirpackage.xmlload with no constraints. When no addons declare<kindred>, the loader uses a legacy order matching the current hard-coded ztools-then-silo sequence.Testing
mods/ztools/package.xmlat depth 1,mods/silo/freecad/package.xmlat depth 2)repr,get(),loaded(),is_loaded(),all()