function [srcs,objs] = getSourceFilesFromDependencyTree(h)
%

%   Copyright 2014 The MathWorks, Inc.

target = h.Components.FinalProduct.TargetInfo;
moduleIdx = find( strcmpi( 'Module', target.TargetDepsType ) );
if isempty(moduleIdx)
    objs = {};
    srcs = {};
else
    objs = target.TargetDeps( moduleIdx );
    srcs = horzcat( target.TargetDepsDeps{ moduleIdx } );
    objsPath = target.TargetDepsPath( moduleIdx );
    for i = 1:numel( objs )
        if ~strcmp( objsPath{ i }, '.' )
            objs{ i } = fullfile( objsPath{ i }, objs{ i } );
        end
    end
end
end
