Love maker (cross platform, automated distribution)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
ivan
Party member
Posts: 1454
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Love maker (cross platform, automated distribution)

Post by ivan » Sun Jul 14, 2019 8:37 am

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.
Please download the following maker.love file and extract it to a folder.
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
(9.13 KiB) Downloaded 3 times
Last edited by ivan on Wed Jul 17, 2019 11:40 am, edited 6 times in total.

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

Re: Love maker (build automation)

Post by ivan » Wed Jul 17, 2019 7:34 am

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
* allows writing/reading comments inside the generated .love file

Post Reply

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests