Open vk2gpu opened 9 years ago
I think you could do something like this already:
function ProcessReflection( path, solutionname)
do stuff and fill table
prebuildcommands {
}
end
configuration "something"
ProcessReflection("<pathX>", solution().name)
configuration "something else"
ProcessReflection("<pathY>", solution().name)
Will this execute what happens in the ProcessReflection function at build time though?
My idea is to run this code when I type 'make', or hit build in Visual Studio, rather than at project generation time. Most of the reason for wanting this is just to unify what scripting language I use for all build related work and bring it all into Lua, potentially using the genie executable as a standalone Lua interpreter for it.
On 8 December 2014 at 11:06, Branimir Karadžić notifications@github.com wrote:
I think you could do something like this already:
function ProcessReflection( path, solutionname)
do stuff and fill table prebuildcommands { }
end
configuration "something" ProcessReflection("
", solution().name) configuration "something else" ProcessReflection("
", solution().name) — Reply to this email directly or view it on GitHub https://github.com/bkaradzic/genie/issues/18#issuecomment-65962537.
Ah I thought you want to process something on project generation time... I wouldn't combine GENie functionality with this. Just build standalone Lua interpreter and script it that way.
Yeah that is probably how itd need to end up. Was kinda hoping to be able to have code from within genie scripts be executed. Never mind though, there is no strict requirement of having that setup. Just thought it might be nice :)
-----Original Message----- From: "Branimir Karadžić" notifications@github.com Sent: 8/12/2014 11:23 AM To: "bkaradzic/genie" genie@noreply.github.com Cc: "Neil Richardson" richyneil@gmail.com Subject: Re: [genie] Lua pre/post build steps. (#18)
Ah I thought you want to process something on project generation time... I wouldn't combine GENie functionality with this. Just build standalone Lua interpreter and script it that way. — Reply to this email directly or view it on GitHub.=
Another idea would be to use the invoke genie to do pre/post-processing through actions. You still need to invoke the interpreter explicitly as you currently are, but you can use Lua without requiring a standalone binary.
I haven't looked at this in any depth, but the 'onproject' and 'onsolution' hooks looks interesting, see http://industriousone.com/topic/chaining-actions if this could be of any use to you.
Edit: The hooks probably aren't of any use for standalone actions though... but actions in general works great for invoking Lua-scripts during a build.
Actions sound like it may be the way forward for this without modifying the code base to explicitly support it. I shall have to have a look!
At the moment I have various scripts setup to do some pre/post build steps, or run the pre build code when generating the projects (which isn't my preferred approach).
I was thinking it might be nice if these could actually just be Lua. Not sure on the best way to go about implementing this, but actually being able to have the Lua inline would be quite nice.
Currently in my game scripts I have this:
It would be nice if I could replace it along the lines of:
Any thoughts on this? I imagine what would need to be done is genie is invoked by the makefiles/vsproj on the pre/post build steps and told to run said Lua function. At a slightly more complex level, it would need to potentially pull out the Lua code referenced and generate new Lua files and tell Genie to invoke those instead.