How do people create their .loves and .exes? (Discussion)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
gestaltist
Prole
Posts: 49
Joined: Thu May 29, 2014 10:56 am

Re: How do people create their .loves and .exes? (Discussion

Post by gestaltist »

I’m on a Mac so I made an Automator script. I select the files I want to include with the mouse and press Command+Shift+L and it creates the Love file for me.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: How do people create their .loves and .exes? (Discussion

Post by Positive07 »

riidom wrote:What are the reasons for creating .love's or .exe's so often, that there is a desire to automate it?
Or asked different, what are the occasions where you do it?
I do it when I need to share with friends or in a jam. Also I used to create love files all the time when I needed to test something but I dont do that anymore
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
SkymarshallHeff
Prole
Posts: 10
Joined: Mon Jun 23, 2014 6:32 pm

Re: How do people create their .loves and .exes? (Discussion

Post by SkymarshallHeff »

I wanted to make a game run on Android, so I've got two batch files for compiling the APKs, as well as one for making a .love -and- another that spins up an EXE w/the required DLLs so I can make a release package - a total of 4 batch files (plus another that runs the game without a .love for quick testing). Here they are:

The simplest - a simple run batch (aptly named run.bat):

Code: Select all

@ECHO OFF
..\love-0.9.1-win32\love.exe --console "%CD%"
The next simplest - makes a .love file (adapted from the first post):

Code: Select all

"C:\PATH\TO\7z.exe" a -tzip builds/game.love * -xr!*.love -xr!*.bat -xr!*.apk -xr!*.ini -xr!*.exe -xr!*.7z
pause
Moving on - compiling an EXE:

Code: Select all

SET wd=%CD%
SET lovedir=C:\PATH\TO\love-0.9.1-win32

CD %lovedir%
copy /Y %wd%\builds\game.love %lovedir%
rmdir /s /q make
mkdir make
copy /b love.exe+%wd%\builds\game.love .\make\game.exe
copy *.dll .\make\*.dll
copy make %wd%\builds\exe\
pause
Up next is compiling a debug APK with love-android-sdl2:

Code: Select all

SET wd=%CD%
for %%* in (.) do SET pkg=%%~n*
SET love=%wd%\builds\game.love
SET builddir=D:\PATH\TO\love-android-sdl2
SET assets=D:\PATH\TO\love-android-sdl2\assets\game.love
SET dbg=D:\PATH\TO\\love-android-sdl2\bin\love_android_sdl2-debug.apk

copy /Y %love% %assets%
cd %builddir%
call ant debug
copy /Y %dbg% %wd%\builds\debug.apk
pause
Lastly, the most unpretty of them all - compiling a release mode APK (this one could be less ugly, but it was 3AM and I was in the zone):

Code: Select all

@ECHO OFF
SET wd=%CD%
for %%* in (.) do SET pkg=%%~n*
SET love=%wd%\game.love
SET builddir=D:\PATH\TO\love-android-sdl2
SET assets=D:\PATH\TO\love-android-sdl2\assets\game.love
SET dbg=D:\PATH\TO\love-android-sdl2\bin\love_android_sdl2-release-unsigned.apk
SET jdk=C:\PATH\TO\jdk1.7.0_60\bin
SET unsigned=%wd%\builds\release-unsigned.apk
SET signed=%wd%\builds\release.apk

del builds\release.apk
copy /Y %love% %assets%
cd %builddir%
call ant release
copy /Y %dbg% %unsigned%
cd /D %jdk%
call jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore D:\PATH\TO\your.keystore %unsigned% KEYSTOREALIAS
call jarsigner -verify %unsigned%
call zipalign -v 4 %unsigned% %signed%
pause
I've got these all sitting in the root directory of my game folder. When they run, a subfolder is made called "builds", which all up will have these files:
  • debug.apk
  • release.apk
  • game.love
  • release-unsigned.apk (by the end of the process I think this one actually is signed, but not aligned
  • directory: /exe (contains game.exe and the love dll's, ready for packaging)
As for why I have them: convenience, mostly. I'm an enterprise developer by trade, so having the ability to compile and go without screwing around fits neatly into my development practices. I plan to make another batch file to rename the EXE/APKs and package them for release as well.
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

Re: How do people create their .loves and .exes? (Discussion

Post by murks »

I've used method one, manual. I've only done one release so far. Due to a last minute change I had to re-package the game for Linux, OSX and Windows just before the deadline. It was done within a few minutes without any problems, so I don't see the need to automate this process. For rare releases I don't think it's worth it. Chances are I would spend more time writing and adjusting the script than I would save by using it.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], slime and 0 guests