I still just think that one would need to parse your source and make assumptions about what your “require” means…
Take this:
if onDevice then
lib='hrtools\_device.lua'
else
lib='hrtools\_simulator.lua'
end
require(lib)
Of course … the runtime in the simulator could look what to load… but how do you want to compile this?
If you do not have the lua files in your project folder… what to add to the final build?!
I know this is somewhat constructed but then… whats about:
local themename=func\_readconfig('theme')
require(themename..'.lua')
where
-- file dark.lua
colors = { 40,40,40 }
-- file light.lua
colors = { 240,240,240 }
require() is a runtime function with a string parameter which does a lot more than you may think. It is not a a feature at compile-time.
In addition require() is already able to search a path. This is the standard implementation in Lua.
You may look up “package.path” … which points to “/Users/xxxx/Documents/XCode-Projekte/MyProject/?.lua;/Applications/Corona2.0-Beta5/Corona Simulator.app/Contents/Resources/?.lua” on my system
and therefore you can copy your libraries into the Resources folder of the simulator to have your wish come true… partially 
But it won’t work on the device… as those files are not getting added to the build!
P.S.: I just find out those stuff myself… I am interested in such things … lol
[import]uid: 6928 topic_id: 1169 reply_id: 3246[/import]