Skip to content

Commit

Permalink
Have auxTools which are always added and marked as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mms-neuro committed Apr 8, 2022
1 parent 79eba82 commit 58ab9c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion misc/tapas_check_for_new_release.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

if verbose % Show info
if ~haveNewerRelease
fprintf(1, 'Your TAPAS version is up-to-date .\n\n');
fprintf(1, 'Your TAPAS version is up-to-date.\n\n');
else
fprintf(1, ['There is a new TAPAS release available (installed %s /'...
+'newest %s)!\n\n'],offline_version,online_version);
Expand Down
4 changes: 3 additions & 1 deletion misc/tapas_get_toolbox_infos.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function infos = tapas_get_toolbox_infos()
function [infos, auxillary_toolboxes] = tapas_get_toolbox_infos()
% Function storing information regarding toolboxes.
%
% Each toolbox is represented by a field with its lower-case-name.
Expand Down Expand Up @@ -58,6 +58,8 @@
infos.external.diagnose_files = '';

infos = tapas_default_toolbox_info(infos,'tools'); % Want to have that?

auxillary_toolboxes = {'external','tools'}; % Just inform - let init decide what to do
end


Expand Down
13 changes: 10 additions & 3 deletions misc/tapas_init_toolboxes.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages)
% In the infos struct, we have all information about our toolboxes (which ones
% we have, what other TAPAS toolboxes they depend on and whether they have a
% init function):
infos = tapas_get_toolbox_infos();
[infos,aux_tools] = tapas_get_toolbox_infos();

% Strategy: Use fieldnames of struct for list of toolboxes. Have boolean array,
% whether to add them.
toolbox_names = fieldnames(infos);
if doInitAll % That's easy: Just add all.
doInit = ones(size(toolbox_names),'logical');
toolboxes = toolbox_names;
toolboxes = toolbox_names(~ismember(toolbox_names,aux_tools));
else
doInit = zeros(size(toolbox_names),'logical');
for iTool = 1:numel(toolboxes) % These are to add (input argument)
Expand All @@ -66,6 +66,9 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages)
end
% Now that we know, which toolboxes (including dependencies) we want to add,
% we can do that.
doInit(ismember(toolbox_names,aux_tools)) = true; % Always add these.


for iTool = 1:numel(toolbox_names) % Now we are iterating over all toolboxes.
if doInit(iTool)
sTool = toolbox_names{iTool};
Expand All @@ -79,7 +82,11 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages)
str(end+1:80+17) = '~'; % 17 for <strong></strong>
fprintf(1,'%s\n',str);
else
fprintf(1,'===== Adding dependent toolbox %s =====\n',sTool);
%fprintf(1,'===== Adding dependent toolbox %s =====\n',sTool);
str = sprintf(['~~~~~~~~~~~~~~~~~~~~~~~~ ADDING DEPENDENCY ',...
'%s ~~~~~~~~~~~~~~~~~~~~~~~~'],upper(sTool));
str(end+1:80) = '~';
fprintf(1,'%s\n',str);
end
end
% If no init function is specified, we add the "genpath(init_dir)".
Expand Down

0 comments on commit 58ab9c4

Please sign in to comment.