%% Customize Build Process with PostCodeGenCommand and Relocate Generated Code to an External Environment
% This example shows how to use the build information programming interface 
% and the model configuration parameter *Post code generation command* (|PostCodeGenCommand|) to customize
% the build process. For this example, *Post code generation command* is set to |rtwdemo_buildinfo_data|. The build process
% invokes that function after code generation.
% 
% The example also shows how to use build configuration function |rtwmakecfg.m|.
%
%% Open Example Model
% Open the example model |rtwdemo_buildinfo|.
open_system('rtwdemo_buildinfo');
%% Generate Code from Model
% Generate code. The code generator produces the file |BuildInfo.html|,
% which documents the build information object.
%% Examine the Build Process Customizations and Output
% Examine the build process customizations and the post code generation query 
% of the build information object. In a Web browser, open the file |BuildInfo.html|. 
% The file provides hyperlinks that you can use to examine the code produced 
% for the model. Alternatively, in the MATLAB Command Window:
%
% * To view the function configured to execute during the post code generation
% stage of the build process, enter:
%
% |get_param('rtwdemo_buildinfo','PostCodeGenCommand');|
%
% * To study the programming interface for the build information object, enter:
%
% |rtwdemo_buildinfo_data(buildInfo);|
%
% * To study how the example uses the |rtwmakecfg| function, enter:
%
% |edit rtwmakecfg.m;|
%
% * To view the build information object data that the build process saves
% in the |buildInfo.mat| file, open the file |rtwdemo_<target>_rtw\buildInfo.mat|.
%
% * To view the contents of the post code generation function
% |rtwdemo_buildinfo_data.m|, enter:
%
% |edit rtwdemo_buildinfo_data.m;|
% 
% At the end of the file, the function calls |packNGo| to package the source 
% and object files that the build information object identifies for relocation.
%% Related Topics
%
% * <docid:rtw_doccenter.build-process-integration Build Process Customization>
% * <docid:rtw_ug.bqobjzq Customize Post-Code-Generation Build Processing>
% * <docid:rtw_ug.bp67trh Use rtwmakecfg.m API to Customize Generated Makefiles>
% * <docid:rtw_ug.bqufw6y Relocate Code to Another Development Environment>
%

%% 
% Copyright 2019 The MathWorks, Inc.