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: 1524
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 83 times
Last edited by ivan on Mon Jul 29, 2019 6:55 am, edited 8 times in total.

User avatar
ivan
Party member
Posts: 1524
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

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

Re: love.maker (cross platform, automated distribution)

Post by ivan » Mon Jul 29, 2019 7:08 am

Moved the code to the following repo:
https://bitbucket.org/itraykov/love.maker/src/master/

Has anybody managed to test this on Linux/Mac?

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

Re: love.maker (cross platform, automated distribution)

Post by ivan » Sat Sep 21, 2019 11:08 am

Wow, nobody found this lib useful at all? That's really surprising.
IMO a lib like this should be built into love2d by default.
Furthermore, it would be good to have CRC32 functionality in love.math too.
Up-vote my request at:
https://bitbucket.org/rude/love/issues/1514/crc32

User avatar
pgimeno
Party member
Posts: 1885
Joined: Sun Oct 18, 2015 2:58 pm
Location: Valencia, ES

Re: love.maker (cross platform, automated distribution)

Post by pgimeno » Sat Sep 21, 2019 12:12 pm

ivan wrote:
Sat Sep 21, 2019 11:08 am
Wow, nobody found this lib useful at all? That's really surprising.
IMO a lib like this should be built into love2d by default.
Maybe people are using it but not providing feedback? :)

Personally I package my programs either manually or with makefiles. I usually have more files in my project folders than those that need to be included, therefore I need to list the files to include manually.

ivan wrote:
Sat Sep 21, 2019 11:08 am
Furthermore, it would be good to have CRC32 functionality in love.math too.
Up-vote my request at:
https://bitbucket.org/rude/love/issues/1514/crc32
I'd prefer a generic CRC class where you can enter the bit width, the polynomial, the bit direction and the initial value, and update() and finish() methods.

The correct place would probably be love.data, where love.data.hash() already resides. Unfortunately, love.data.hash() does not include update() and finish(), so maybe for consistency the CRC function shouldn't either. Or conversely, perhaps it would be nice to have a love.data.newHash() that returns an object with update() and finish() methods.

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

Re: love.maker (cross platform, automated distribution)

Post by ivan » Sat Sep 21, 2019 2:26 pm

pgimeno wrote:
Sat Sep 21, 2019 12:12 pm
I usually have more files in my project folders than those that need to be included, therefore I need to list the files to include manually.
True, it's often more complicated than just zipping the entire game folder.
Using the lib above, you can filter and ignore files using pattern matching: build:ignoreMatch('^/.git') or based on extension.
Now if you wanted to include files from outside of the game folder then things get hairy.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests