Skip to content

Commit

Permalink
bricks: Use own manifest file.
Browse files Browse the repository at this point in the history
Not all hubs will need all modules.
  • Loading branch information
laurensvalk committed Dec 3, 2024
1 parent 8dc43f3 commit 442d75a
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 7 deletions.
4 changes: 1 addition & 3 deletions bricks/_common/arm_none_eabi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ include $(PBTOP)/micropython/py/mkenv.mk

# Include common frozen modules.
ifeq ($(PB_FROZEN_MODULES),1)
ifneq ("$(wildcard $(PBTOP)/bricks/_common/modules/*.py)","")
FROZEN_MANIFEST ?= ../_common/manifest.py
endif
FROZEN_MANIFEST ?= manifest.py
endif

# qstr definitions (must come before including py.mk)
Expand Down
5 changes: 2 additions & 3 deletions bricks/_common/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

if any(modules):
for m in modules:
path, file = m.parts
print(f"Including {m.stem} as a module.")
freeze_as_mpy(path, file)
print(f"Including {m.name} as a module.")
freeze_as_mpy(str(m.parent), m.name)
1 change: 0 additions & 1 deletion bricks/_common/modules/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.py
!_hub_extra.py
!_builtin_port_view.py
1 change: 1 addition & 0 deletions bricks/cityhub/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("../_common/manifest.py")
1 change: 1 addition & 0 deletions bricks/debug/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("../_common/manifest.py")
2 changes: 2 additions & 0 deletions bricks/essentialhub/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# including same modules as primehub
include("../primehub/manifest.py")
1 change: 1 addition & 0 deletions bricks/ev3/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("../_common/manifest.py")
1 change: 1 addition & 0 deletions bricks/nxt/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("../_common/manifest.py")
12 changes: 12 additions & 0 deletions bricks/primehub/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pathlib

# Common modules
include("../_common/manifest.py")

# PrimeHub additions, like IMU.
primehub_modules = list(pathlib.Path("../primehub/modules").glob("*.py"))

if any(primehub_modules):
for m in primehub_modules:
print(f"Including {m.name} as a module.")
freeze_as_mpy(str(m.parent), m.name)
File renamed without changes.
2 changes: 2 additions & 0 deletions bricks/technichub/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# including same modules as primehub
include("../primehub/manifest.py")

0 comments on commit 442d75a

Please sign in to comment.