Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
artefacts/** linguist-generated

* text=lf
* eol=lf
47 changes: 47 additions & 0 deletions .github/workflows/generate_artefacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Generate Artefacts

on:
push:
paths:
- "generators/**"
- "src/**"
- ".github/workflows/generate_artefacts.yml"
workflow_dispatch:

jobs:
generate-and-push:
runs-on: ubuntu-latest

permissions:
contents: write
actions: read

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Python deps
run: |
pip install jinja2 --disable-pip-version-check

- name: Run primitive generator
run: |
make primitives

- name: Commit artefacts
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git add -f artefacts/

git commit -m "Regenerate artefacts automatically [skip ci]"
git push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ libilo.so
.build
compile_commands.json

# C binaries
trame-exporter

# PlatformIO
.pio
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ install: $(NAME_release)
uninstall:
$(RM) $(BINDIR)/$(NAME_release)

trame-exporter: src/trame.c
$(LINK.c) -o $@ generators/generate-trame-json.c
@ $(LOG_TIME) "$(C_GREEN) CC $(C_PURPLE) $(notdir $@) $(C_RESET)"

artefacts/trames.json: trame-exporter
@ ./$< > $@
@ $(LOG_TIME) "$(C_GREEN) GEN $(C_PURPLE) $(notdir $@) $(C_RESET)"


.PHONY: primitives
primitives: artefacts/trames.json
@ python generators/generate_primitives.py


V ?= 0
ifneq ($(V),0)
Expand Down Expand Up @@ -70,17 +83,17 @@ endif

NOW = $(shell date +%s%3N)

ifndef STIME
STIME := $(call NOW)
endif
STIME := $(shell date +%s%3N)
export STIME

TIME_NS = $(shell expr $(call NOW) - $(STIME))
TIME_MS = $(shell expr $(call TIME_NS))
define TIME_MS
$$( expr \( $$(date +%s%3N) - $(STIME) \))
endef

BOXIFY = "[$(C_BLUE)$(1)$(C_RESET)] $(2)"

ifneq ($(shell command -v printf),)
LOG_TIME = printf $(call BOXIFY, %6s ,$(strip %b\n)) "$(call TIME_MS)"
LOG_TIME = printf $(call BOXIFY, %6s , %b\n) "$(call TIME_MS)"
else
LOG_TIME = echo -e $(call BOXIFY, $(call TIME_MS) ,)
endif
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Packaging status:
## PIO
# Lib Ilo

[![PlatformIO Registry](https://badges.registry.platformio.org/packages/intuition-rt/library/ilo.svg)](https://registry.platformio.org/libraries/intuition-rt/ilo)

## PyPi
...
Ce projet contiens les différentes libraries nécessaire au bon fonctionnement de la communication avec ilo.

Afin de simplifier le dévelopement, tout la partie communication est génération à partir d'une unique source de vérité. Cela permet d'assure que les different bindings sont synchronisé et utilise les mêmes trames.

## Layout

```c
artefacts/ # contenu généré automatiquement
├── primitives/ # abstraction simple des trames en fonctions
│ └── {cpp,python,flutter}/
└── trames.json
bindings/ # wrapper au dessus des primitives
└── {cpp/python/flutter}/
core/ # source de vérité des des données
generators/
└── generate_primitives.py
```
2 changes: 2 additions & 0 deletions artefacts/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions artefacts/cpp/trame_builder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading