From: <pu...@us...> - 2006-02-14 16:02:24
|
J. Perkins wrote: > On 2/1/06, Jens Thee=DF <pu...@us...> wrote: >> So what I propose is this: a plugin system for backends. These could b= e >> shared libraries or maybe just lua scripts. >=20 > In theory, I like this idea, and I have thought about it in the past. > It is reasonably easy to implement. >=20 > So...I am going to continue to ship Premake as a single, all-inclusiv= e > file. However, I am not opposed to the idea of enabling end-user > addons, with the understanding that popular addons will be merged into > the core, and not the other way around. If you would like to propose a > system, I will consider implementing it. Is that reasonable? That will be perfect. I started using premake on small hobby projects,=20 but there are two requirements I have before using it at work: * Easy to do custom targets. Especially the ability to easily modifiy the "gnu" target is a must for me (or rather, my boss). * Support for writing target generators using some templating engine (this is not a strong requirement). >> * Writing backends in plain C is awkward. Why not use a template >> engine like Velocity, or Lua with Text Template >> (http://lua-users.org/wiki/TextTemplate)? >=20 > I would love to use a template engine, if I could figure out a way to > embed everything into a single executable, for the reasons described > above. Any takers? Did you get my second mail on this topic? Attached was an expirmental=20 lua script using the Text Template engine (Expand.lua) to produce a=20 simple codeblocks project file. Velocity wouldn't work actually, as it=20 is a java library, but I'm sure something similar must exist for C or C++= . I poked around the premake sources to see how easy it would be to=20 support lua scripts as target generators. The major thing to do I've=20 seen so far is to make the packages defined in premake.lua available to=20 the generator script. The script itself could be included into=20 premake.exe by transforming it into a .h file (optionally compiling it=20 to bytecode first). Could you make a function like script_init() which=20 defines a global "packages" table containing all the packages defined by=20 the premake.lua scripts? I'm not yet that familiar with the lua C api.=20 Then I could more easily try out this "generating targets using lua"=20 approach. Jens |