~n0mn0m/gencon-portal

00e50f8432cfc36170604f1464ecb0de9042b556 — Alexander Hagerman 10 months ago 45d0c88 + 8001614 master
Add mpy and build.

Add make commands for using mpy-cross. Setup gitlab ci build for checkins to build .mpy files.
3 files changed, 45 insertions(+), 3 deletions(-)

M .gitignore
A .gitlab-ci.yml
M Makefile
M .gitignore => .gitignore +6 -0
@@ 123,3 123,9 @@ dmypy.json
.pyre/

.DS_Store

# CircuitPython mpy-cross https://github.com/adafruit/circuitpython/tree/master/mpy-cross
circuitpython

# Build artifacts
artifacts/

A .gitlab-ci.yml => .gitlab-ci.yml +13 -0
@@ 0,0 1,13 @@
image: python:3.7

build:
  script:
    - apt-get -y update
    - apt-get install -y make gettext
    - mkdir artifacts/
    - make get-mpy-cross
    - make build
    - make save
  artifacts:
    paths:
      - artifacts/

M Makefile => Makefile +26 -3
@@ 1,4 1,27 @@
copy:
SHELL := /bin/bash

copy: build save
	cp code.py /Volumes/PYPORTAL
	cp lib/menu.py /Volumes/PYPORTAL/lib
	cp lib/utils.py /Volumes/PYPORTAL/lib
\ No newline at end of file
	cp artifacts/menu.mpy /Volumes/PYPORTAL/lib
	cp artifacts/utils.mpy /Volumes/PYPORTAL/lib

save:
	mv lib/menu.mpy artifacts/
	mv lib/utils.mpy artifacts/

build:
	@pushd circuitpython/mpy-cross/ ; \
		./mpy-cross ../../lib/menu.py; \
		./mpy-cross ../../lib/utils.py; \
	popd

# https://learn.adafruit.com/building-circuitpython/build-circuitpython
get-mpy-cross:
	pip install huffman
	git clone https://github.com/adafruit/circuitpython.git;
	pushd circuitpython; \
	git submodule update --init --recursive; \
	popd
	pushd circuitpython/mpy-cross; \
	make; \
	popd