function ret = addSourceFiles(h, varargin)
% ADDSOURCEFILES The addSourceFiles function adds specified source files to
% the model's build information. Real-Time Workshop stores the source files in
% a vector. The function adds the filenames to the end of the vector in the
% order that you specify them.
%
% Argument description
% buildinfo Build information handle returned by RTW.Buildinfo.
%
% filenames A character array or cell array of character arrays that
% specifies names of source files to be added to the build
% information. The function adds the filenames to the end of a
% vector in the order that you specify them.
% The function removes duplicate source file entries that
% - Already exist in the source file vector
% - Have a path that matches the path of a matching filename
% A duplicate entry consists of an exact match of a path string and
% corresponding filename.
%
% paths (optional) A character array or cell array of character arrays
% that specifies paths to the source files. The function adds the
% paths to the end of a vector in the order that you specify
% them. If you specify a single path as a character array, the
% function uses that path for all files.
%
% groups (optional) A character array or cell array of character arrays
% that groups specified source files
%
% example 1:
% myModelBuildInfo = RTW.BuildInfo;
% addSourceFiles(myModelBuildInfo, 'driver.c', 'Drivers');
%
% example 1:
% myModelBuildInfo = RTW.BuildInfo;
% addSourceFiles(myModelBuildInfo,..
% {'test1.c' 'test2.c' 'driver.c'},...
% {'Tests' 'Tests' 'Drivers'});
%
% Please refer to the documentation for more information.
%

% Copyright 2005-2019 The MathWorks, Inc.
[varargin{:}] = convertStringsToChars(varargin{:});
ret = h.addFiles('source', varargin{:});