Closed fmahnke closed 6 years ago
Based on my reading of the README file for picotool, there isn't support for multiple .lua files. My tool definitely supports multiple .p8 files though for anyone else that wants a bit more code organization like I did.
Thanks! My current solution is to cat the different .lua files together, then use picotool as usual.
This can cause strange errors if I'm not careful, so I'll eventually want something more robust. I'll check out yours.
It's easy enough to script simple concatenation with picotool, which sounds like what you're already doing:
cat s1.lua s2.lua s3.lua >/tmp/cat.lua
p8tool build --lua /tmp/cat.lua mycart.p8.png
I have plans for a more robust version of this, but they're elaborate enough plans that I haven't finished it yet. :)
p8tool build --lua source.lua
now supports source.lua
containing a require()
statement it in, with elaborate support for that. That'll be the built-in support for multiple Lua files. You can still script your own concatenation method as above, if that's preferred.
@dansanderson That sounds awesome and much more robust than my concatenation method.
Is assembling a cart from multiple lua files supported?
My use case is to separate my reusable code into multiple .lua files, then bring the library code for my different systems into the cart file.