It has been discussed that we should move away from using conf.lua possible in version 3 ( #40 ) and that this would help on moving to a Lua version agnostic ( #46 ) system.
To do this we need to define a new format for the configuration, so I decided to open this issue only to discuss how this format should be. I propose this package.lua file format:
local release = require 'plugin.loverelease'
local commands = {}
function commands.build ()
release.cacheDirectory('cache')
local metadata = {
name = 'Test game'
version = '0.0.1'
description = 'A test game for love-release',
author = 'Positive07',
email = 'pablo.a.mayobre@gmail.com',
url = 'https://github.com/Positive07/test',
}
local love = release.newLove {
src = '.',
include = {},
exclude = {'.gitignore', 'package.lua', 'README.md'},
}
local icons = release.getIcons {
'32' = 'icon32.png'
}
local mac = release.newMacOSX {
file = love,
meta = metadata,
icon = icons.icns,
}
local win32 = release.newWindows {
file = love,
meta = metadata,
icon = icons.ico,
arch = 32,
}
local win64 = win32:fork {
arch = 64
}
release.output 'build' {
['game-windows-32'] = win32,
['game-windows-64'] = win64,
['game-love'] = love,
['game-mac'] = mac
}
end
return commands
So this file returns a list of commands, this commands can be executed by running them like so:
When the file runs, the release plugin is loaded with require from an specific plugin directory of love-release. This plugin exposes some common operations like newLove, newWindows and newMacOSX, please note that this don't really create files, but configure tasks.
The tasks are executed with release.output which first takes the directory and returns a reusable function, that when called with a table with tasks as values performs all the tasks and saves the resulting files in the specified directory with a name corresponding to their index. This functions is synchronous and may take it's time, so that is something to keep in mind.
Most tasks take a love task, this is so that the generated LÖVE (.love) file can be reused, but reusing a file is not required.
Lastly I want to note that all the tasks have a branch method that allows you to create a new task with all the same configurations as the task you are branching from and change only the specified configurations.
This is my proposal, please give it a thumbs up 👍 if you are in favor or discuss any changes you would like to make. I would like to see different proposals too, to spark more ideas on this kind of stuff!
It has been discussed that we should move away from using
conf.luapossible in version 3 ( #40 ) and that this would help on moving to a Lua version agnostic ( #46 ) system.To do this we need to define a new format for the configuration, so I decided to open this issue only to discuss how this format should be. I propose this
package.luafile format:So this file returns a list of commands, this commands can be executed by running them like so:
When the file runs, the
releaseplugin is loaded with require from an specific plugin directory of love-release. This plugin exposes some common operations likenewLove,newWindowsandnewMacOSX, please note that this don't really create files, but configure tasks.The tasks are executed with
release.outputwhich first takes the directory and returns a reusable function, that when called with a table with tasks as values performs all the tasks and saves the resulting files in the specified directory with a name corresponding to their index. This functions is synchronous and may take it's time, so that is something to keep in mind.Most tasks take a
lovetask, this is so that the generated LÖVE (.love) file can be reused, but reusing a file is not required.Lastly I want to note that all the tasks have a
branchmethod that allows you to create a new task with all the same configurations as the task you are branching from and change only the specified configurations.This is my proposal, please give it a thumbs up 👍 if you are in favor or discuss any changes you would like to make. I would like to see different proposals too, to spark more ideas on this kind of stuff!