## Love maker (cross platform, automated distribution)

ivan
Party member
Posts: 1454
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

### Love maker (cross platform, automated distribution)

Greetings folks.
Got a pretty neat tool that can save you a ton of time if you make a lot of revisions to your game.
It's an automatic .LOVE builder implemented in Lua without requiring any external binaries.
Run the maker from a folder to build your .love file:

Code: Select all

love maker --build
This will auto-generate "maker.love" right there in the same working folder.
You should obviously rename the folder to whatever you like and use the maker as a template.
Would love to get any feedback from Mac/Linux users since I haven't tested it on those platforms.

Basic API
The lib allows you to customize your build and filter files by extensions, filename and even using pattern matching!
The maker.zip function can output anywhere which is super useful if you are using other tools (like Android's APK tool or Valve's ContentBuilder)

Code: Select all

love.maker = require("maker.main")
local build = love.maker.newBuild("lua", "txt", "png") -- include ONLY the selected formats
build:ignore('/readme.txt') -- ignore specific files or folders
build:ignoreMatch('^/.git') -- ignore based on pattern matching
build:allow("/images/exception.jpg") -- whitelist a specific file
build:save(dest, "DEMO") -- absolute path and comment/stamp
local stamp = love.maker.getComment(dest) -- get the stamp
Special thanks
RamiLego4Game and his file zipping library
bit.numberlua library (replaced with FFI's bitops)

Limitations
*Generates a .love file only from the current folder (the destination love file could be placed anywhere)
*Does not support fused games (it could be done - but we would have to include the binaries for all platforms)
*Empty directories are not included in the generated file (this looks like a limitation of Rami's library)
Attachments
maker.love
Last edited by ivan on Wed Jul 17, 2019 11:40 am, edited 6 times in total.

ivan
Party member
Posts: 1454
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

### Re: Love maker (build automation)

Update:
* 150% faster thanks to FFI bitops
* 50% faster since we don't create an intermediate folder
* 15% faster after profiling Rami's code (fixed a bottleneck in CRC32)
* should be thread safe by using os.tmpname