From 0f41ae4bc8ddf16bb25ea2ac6cfc11f7b3e3e38a Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 9 Jul 2015 09:36:14 +0200 Subject: [PATCH] Update/fix rpp_build_demos to support different "calling conventions" This function was broken, because when invoked from Makefile, it built only the first demo and not all demos specified as arguments. This is now fixed. Now, the function also accepts a single cell array with demo names. This will be used by buildbot. --- rpp/demos/rpp_build_demos.m | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rpp/demos/rpp_build_demos.m b/rpp/demos/rpp_build_demos.m index 3acb9e7..e46acef 100644 --- a/rpp/demos/rpp_build_demos.m +++ b/rpp/demos/rpp_build_demos.m @@ -1,4 +1,13 @@ -% Copyright (C) 2013-2014 Czech Technical University in Prague +% RPP_BUILD_DEMOS Builds all or selected demos in the demo folder +% RPP_BUILD_DEMOS builds all demos in the demo directory. +% +% RPP_BUILD_DEMOS DEMO1 DEMO2 ... builds only the demos +% mentioned on the command line. +% +% RPP_BUILD_DEMOS(CELLSTR) builds demos specified in the cell +% array of strings CELLSTR. + +% Copyright (C) 2013-2015 Czech Technical University in Prague % % Authors: % - Michal Sojka @@ -17,8 +26,14 @@ function rpp_build_demos(varargin) d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos'); cd(d) - if nargin > 0, - build_demo(varargin{1}); + if nargin == 1 && iscell(varargin{1}), + for i=1:length(varargin{1}), + build_demo(varargin{1}{i}) + end + elseif nargin > 0, + for i=1:nargin, + build_demo(varargin{i}); + end else for i=dir('*.slx')', build_demo(i.name); -- 2.39.2