-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmanifest.py
54 lines (41 loc) · 1.94 KB
/
manifest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""
Custom manifest.py file to include packages from pydisplay
To include this file with your MicroPython build, add the following line to your
make command, replacing the path with the correct path to this file:
FROZEN_MANIFEST=$(MPY_DIR)/../pydisplay/manifest.py
Available variables:
$(MPY_DIR) # path to the micropython repo.
$(MPY_LIB_DIR) # path to the micropython-lib submodule. Prefer to use require().
$(PORT_DIR) # path to the current port (e.g. ports/stm32)
$(BOARD_DIR) # path to the current board (e.g. ports/stm32/boards/PYBV11)
Available functions:
add_library(library, library_path, prepend=False) # for example: add_library("micropython-lib", "$(MPY_DIR)/lib")
package(package_path, files=None, base_path='.', opt=None) # multiple files, usually with __init__.py
module(module_path, base_path='.', opt=None) # single file
require(name, library=None) # from a library
include(manifest_path) # include another manifest file
metadata(description=None, version=None, license=None, author=None)
"""
# This file is to be given as
# make FROZEN_MANIFEST=<PATH>/manifest.py
import os
if 0:
def include(*args, **kwargs):
pass
def package(*args, **kwargs):
pass
def module(*args, **kwargs):
pass
def require(*args, **kwargs):
pass
if os.path.exists(os.path.join("$(BOARD_DIR)", "manifest.py")):
include("$(BOARD_DIR)/manifest.py")
elif os.path.exists(os.path.join("$(PORT_DIR)", "boards", "manifest.py")):
include("$(PORT_DIR)/boards/manifest.py")
elif os.path.exists(os.path.join("$(PORT_DIR)", "variants", "standard", "manifest.py")):
include("$(PORT_DIR)/variants/standard/manifest.py")
package("displaysys", base_path="./src/lib", opt=3)
package("eventsys", base_path="./src/lib", opt=3)
package("graphics", base_path="./src/lib", opt=3)
package("multimer", base_path="./src/lib", opt=3)
package("palettes", base_path="./src/lib", opt=3)