Member attributes: PostProcess
This attribute determines a command to execute at the end of the build process.
Syntax
EXE‑BAT‑CMD‑file‑nameargument ...
Discussion
The attribute PostProcess allows you to specify a command to execute just after the code generation for the respective profile member has finished successfully. The command can consist of an EXE, BAT or CMD file name followed by any arbitrary arguments. For example, the value make.exe /f makefile.mak assigned to this attribute would start the program make.exe with the specified arguments /f makefile.mak.
This attribute is optional. If specified, Embedded Wizard searches for the EXE, BAT or CMD file, starts its execution in a child process and waits until it terminates. The working directory for the child process is the actual project directory. Eventual outputs of the command are intercepted and stored in a postprocess.log file within the destination directory of the affected profile. Errors are displayed in the Log window.
If no absolute path is specified for the command file, Embedded Wizard looks for it in the current project directory and then in the Embedded Wizard installation directory. In case of an EXE file, also directories listed in the Windows environment variable PATH are evaluated in order to locate the file.
The value for this attribute can involve Windows environment variables. For this purpose enclose the environment variable between a pair of % (percent) signs. For example, initializing the attribute with the value %SDK_PATH%\make.exe will start the program make.exe found in the directory resulting from the Window environment variable SDK_PATH.
Modify the attribute
To inspect or modify the value of an PostProcess attribute, select first the affected profile member. Thereupon, the attribute is listed in the middle area of Inspector. Please note the available file selection assistant you can activate by clicking on the button right to the attribute:
Environment variables
When starting the command, Embedded Wizard provides the child process with information regarding the actual project and the just performed code generation. With this information the started command can evaluate the code generation parameters, estimate the names of all generated files and perform all necessary post process operations.
This information is provided in environment variables, the child process can access and evaluate easily. For example, a regular MS-Windows batch file (*.cmd or *.bat) can access and evaluate an environment variable by simply specifying its name enclosed between a pair of % (percent) signs. Accordingly, the expression %EmWi_Version% used within a *.cmd batch file would result in the actual version number of Embedded Wizard Studio which has started the batch file.
The following table provides an overview of all available environment variables and their particular content:
Variable name |
Description |
---|---|
EmWi_Version |
Corresponds to the version of Embedded Wizard Studio according to the following syntax: major‑version.minor‑version major‑version.minor‑version.release‑version For example: 9.20 |
EmWi_InstallDirectory |
Contains the full path to the directory with the used Embedded Wizard Studio installation. For example: C:\Programs\Embedded Wizard 9.20 |
EmWi_ProjectFile |
Contains the full path to the actually opened Embedded Wizard project file. For example: C:\Users\Paul\Documents\Embedded Wizard Projects\SmartWatch\SmartWatch.ewp |
EmWi_Profile |
Contains the name of the profile used for the actual code generation. For example: Profile_DeviceRevA |
EmWi_Platform |
Contains the full name of the Platform Package selected in the profile the code is currently generated for. The value of this variable corresponds thus to the value of this profile's attribute PlatformPackage. For example: Apple.iOS.RGBA8888 |
EmWi_ScreenSize |
Contains the display resolution in pixel as it is specified in the profile the code is currently generated for. The value of this variable corresponds thus to the value of this profile's attribute ScreenSize. The value has following syntax: width,height For example: 320,240 |
EmWi_ScreenOrientation |
Contains a value describing the display orientation as it is specified in the profile the code is currently generated for. The value of this variable corresponds thus to the value of this profile's attribute ScreenOrientation. The variable can assume one of the following values: Normal, Rotated_90, Rotated_180 or Rotated_270 For example: Rotated_180 |
EmWi_SurfaceRotation |
Contains a value describing the display orientation as it is specified in the profile the code is currently generated for. The value of this variable corresponds thus to the value of this profile's attribute ScreenOrientation. The variable can assume one of the following values: 0, 90, 180 or 270 For example: 180 |
EmWi_ColorFormat |
Contains the name of the color format the code is currently generated for. The value of this variable depends on the Platform Package selected in the profile attribute PlatformPackage. The variable can assume one of the following values: RGBA8888, RGB888, RGBA4444, RGB565, LumA44, Index8 For example: RGB565 |
EmWi_OutputDirectory |
Contains the full path to the directory where common files have been stored during the actual code generation. The value of this variable results from the setting of the profile's attribute OutputDirectory. For example: c:\temp\SmartWatch\code |
EmWi_OutputFileNameExtension |
Contains the extension for all C source files created during the actual code generation. The value of this variable results from the setting of the profile's attribute OutputFileNameExtension. For example: cpp |
EmWi_OutputIncDirectory |
Contains the full path to the directory where include files (e.g. *.h) have been stored during the actual code generation. The value of this variable results from the setting of the profile's attribute OutputIncDirectory. For example: c:\temp\SmartWatch\code\inc |
EmWi_OutputSrcDirectory |
Contains the full path to the directory where source files (e.g. *.c) have been stored during the actual code generation. The value of this variable results from the setting of the profile's attribute OutputSrcDirectory. For example: c:\temp\SmartWatch\code\src |
EmWi_OutputResDirectory |
Contains the full path to the directory where resource files (e.g. *.png) have been stored during the actual code generation. The value of this variable results from the setting of the profile's attribute OutputResDirectory. For example: c:\temp\SmartWatch\code\res |
EmWi_OutputIncFiles |
Contains the names of all include files (e.g. *.h) created during the code generation within the directory represented by the above described variable EmWi_OutputIncDirectory. The file names are separate by a blank sign. For example: Core.h Effects.h Graphics.h Resources.h Views.h |
EmWi_OutputSrcFiles |
Contains the names of all source files (e.g. *.c) created during the code generation within the directory represented by the above described variable EmWi_OutputSrcDirectory. The file names are separate by a blank sign. For example: Core.c Effects.c Graphics.c Resources.c Views.c |
EmWi_OutputResFiles |
Contains the names of all resource files (e.g. *.png) created during the code generation within the directory represented by the above described variable EmWi_OutputResDirectory. The file names are separate by a blank sign. For example: Default.png Logo.png |
EmWi_OutputFiles |
Contains the names of all remaining files created during the code generation within the common directory represented by the above described variable EmWi_OutputDirectory. The file names are separate by a blank sign. For example: ewfile.inc ewfiles.lst |
EmWi_ApplicationName |
Contains the application name identifier as it is specified in the profile the code is currently generated for. The value of this variable corresponds thus to the value of this profile's attribute ApplicationName. The value has following syntax: identifier For example: MyApplication Please note, if there is no value specified in the attribute ApplicationName, the environment variable EmWi_ApplicationName is not defined. It does not exists in such case. |