Skip to content

Commit

Permalink
RDK-45298: Development settings added
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-hobgarski-red committed Nov 8, 2023
1 parent 5560a6e commit 5a4b8a7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion daemon/process/source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,21 @@ static void parseArgs(int argc, char **argv)
*/
static std::shared_ptr<Settings> createSettings()
{
// create settings from either defaults or JSON settings file
// create settings from either defaults, development or JSON settings file
std::shared_ptr<Settings> settings;

#if (AI_BUILD_TYPE == AI_DEBUG)
// Development settings path, used only in debug builds
// Set to a writeable and persistent location to simplify development and debugging
const std::string DEV_SETTINGS_PATH{"/opt/dobby.json"};
if(access(DEV_SETTINGS_PATH.c_str(), R_OK) == 0)
{
AI_LOG_INFO("parsing settings from development file @ '%s'", DEV_SETTINGS_PATH.c_str());
settings = Settings::fromJsonFile(DEV_SETTINGS_PATH);
}
else
#endif

if (!gSettingsFilePath.empty() && (access(gSettingsFilePath.c_str(), R_OK) == 0))
{
AI_LOG_INFO("parsing settings from file @ '%s'", gSettingsFilePath.c_str());
Expand Down

0 comments on commit 5a4b8a7

Please sign in to comment.