]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Update/fix rpp_build_demos to support different "calling conventions"
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Jul 2015 07:36:14 +0000 (09:36 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Jul 2015 07:42:51 +0000 (09:42 +0200)
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

index 3acb9e70771a042fb405c484595a2fea4f891a21..e46acefc64eacc5a9cac562afb034dfae3da162d 100644 (file)
@@ -1,4 +1,13 @@
-% Copyright (C) 2013-2014 Czech Technical University in Prague\r
+% RPP_BUILD_DEMOS Builds all or selected demos in the demo folder\r
+%     RPP_BUILD_DEMOS builds all demos in the demo directory.\r
+%\r
+%     RPP_BUILD_DEMOS DEMO1 DEMO2 ... builds only the demos\r
+%     mentioned on the command line.\r
+%\r
+%     RPP_BUILD_DEMOS(CELLSTR) builds demos specified in the cell\r
+%     array of strings CELLSTR.\r
+\r
+% Copyright (C) 2013-2015 Czech Technical University in Prague\r
 %\r
 % Authors:\r
 %     - Michal Sojka <sojkam1@fel.cvut.cz>\r
@@ -17,8 +26,14 @@ function rpp_build_demos(varargin)
     d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');\r
     cd(d)\r
 \r
-    if nargin > 0,\r
-        build_demo(varargin{1});\r
+    if nargin == 1 && iscell(varargin{1}),\r
+        for i=1:length(varargin{1}),\r
+            build_demo(varargin{1}{i})\r
+        end\r
+    elseif nargin > 0,\r
+        for i=1:nargin,\r
+            build_demo(varargin{i});\r
+        end\r
     else\r
         for i=dir('*.slx')',\r
             build_demo(i.name);\r