Skip to content

Commit

Permalink
Add Makefile for rebuilding bindings
Browse files Browse the repository at this point in the history
Having a makefile is a nice little trick to re-run the binding
generation code without having to copy-paste and/or remember the right
docker incantations :)
  • Loading branch information
arnetheduck committed Jan 11, 2025
1 parent 3d864cd commit 7747bff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/miqt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Linux64 docker build
run: docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .


- name: Cache clang ASTs
uses: actions/cache@v4
with:
path: cmd/genbindings/cachedir
key: linux64-clang-cache

- name: Rebuild binding source
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings'
run: make

- name: Assert no changes
run: git update-index --really-refresh && git diff-index HEAD
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
# android temporary build files
android-build
deployment-settings.json

*.docker-buildstamp
compile_flags.txt
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
BUILDSTAMPS = docker/genbindings.docker-buildstamp

all: genbindings

docker/genbindings.docker-buildstamp: docker/genbindings.Dockerfile
docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
touch $@

clean:
docker image rm -f miqt/genbindings:latest
rm -f $(BUILDSTAMPS)

genbindings: $(BUILDSTAMPS)
docker run -v ~/.cache/go-build:/root/.cache/go-build -v $$PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings'

.PHONY : all clean genbindings

0 comments on commit 7747bff

Please sign in to comment.