Is it possible to read build.settings

In answer to the obvious question, “why ?” so modules can check the build.settings is correctly set up for building. I have an icon/title page scaler that runs in standard lua, that uses dofile() but that isn’t supported in Corona and you can’t require it because it isn’t a .lua file.

There are no API’s to access it and the data table is never loaded into the application.  It’s literally used by the build servers only.  The file doesn’t make it into the .app or .apk bundles that I’m aware of. 

Rob

Okay, thanks for replying.

@Paul,

On the occasion that I want to use what I’ve put in build.settings to make a decision, I make a copy of the file named build_settings.lua in the root folder.  Then, I modify that file as follows.

Let’s say I start with this:

settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, }

I modify it like this:

local settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, } return settings

Finally, I require this file and viola, I’ve got a table containing my build settings.

local build\_settings = require "build\_settings" print(build\_settings.orientation.default) -- prints: "landscapeRight"

I do the same as @roaminggamer, except that I symlink it so I don’t have to remember to make a new copy if I make a change (I’m lazy ;) ). One “drawback” would be that when you require it, it will create an extra global named “settings”, but I can live with that. Having said that I’ve only done it once…a long time ago.

I do the same for config.lua (without the symlink of course) to get access to the config settings.

There are no API’s to access it and the data table is never loaded into the application.  It’s literally used by the build servers only.  The file doesn’t make it into the .app or .apk bundles that I’m aware of. 

Rob

Okay, thanks for replying.

@Paul,

On the occasion that I want to use what I’ve put in build.settings to make a decision, I make a copy of the file named build_settings.lua in the root folder.  Then, I modify that file as follows.

Let’s say I start with this:

settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, }

I modify it like this:

local settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, } return settings

Finally, I require this file and viola, I’ve got a table containing my build settings.

local build\_settings = require "build\_settings" print(build\_settings.orientation.default) -- prints: "landscapeRight"

I do the same as @roaminggamer, except that I symlink it so I don’t have to remember to make a new copy if I make a change (I’m lazy ;) ). One “drawback” would be that when you require it, it will create an extra global named “settings”, but I can live with that. Having said that I’ve only done it once…a long time ago.

I do the same for config.lua (without the symlink of course) to get access to the config settings.