Environment Variable in "run" for adef file

Hi, not sure what I am getting wrong. I use environment variables in my build and use them in the adef and other xdef files.

But I have a scenario where the environment variable is not being replaced with its value for the processes->run section, however it is being resolved further down in the required->device section.

I use the env var (MY_ENV_VAR) as follows

executables:
{
	App1= (AppComponent)
}

processes:
{
	envVars:
	{
		LE_LOG_LEVEL = DEBUG
	}

	run:
	{
		( set-iptables.sh)
		( App1 -start ${MY_ENV_VAR} )
	}
	faultAction: restartApp
	maxCoreDumpFileBytes: 512K
	maxFileBytes: 512K
}

where is the MY_ENV_VAR defined?

Here is an example of putting argument to the application:

MY_ENV_VAR is set outside in the shell when the app is built… as I said it is available as the other part of the adef resolves it correctly… however I need to pass it into the application through the command line argument… which I can do statically… but I want my command line argument to be dynamic and based on the environment variable at build time…

then can you make a script to generate the adef everytime before the app is built?

It seems the env vars in the exec section cannot be expanded… it is a pity as I’d prefer to just pass in the settings…

I am working around this by using the #if options… its not ideal… but will work…