Skip to content
Snippets Groups Projects
Commit 456b9288 authored by Mark Winter's avatar Mark Winter
Browse files

New sped-up compiling, there may be a danger of missing toolbox dependencies.

parent 0aa40c0e
No related branches found
No related tags found
No related merge requests found
...@@ -136,9 +136,22 @@ system(['copy ..\c\GrayScaleCrop\Release_' buildplatform '\GrayScaleCrop.exe ' b ...@@ -136,9 +136,22 @@ system(['copy ..\c\GrayScaleCrop\Release_' buildplatform '\GrayScaleCrop.exe ' b
mcrfile = mcrinstaller(); mcrfile = mcrinstaller();
system(['copy "' mcrfile '" "' bindir '\"']); system(['copy "' mcrfile '" "' bindir '\"']);
toolboxAddCommand = '';
depToolboxes = Dev.GetToolboxDependencies();
if ( ~isempty(depToolboxes) )
toolboxAddCommand = '-N';
for i=1:length(depToolboxes)
toolboxAddCommand = [toolboxAddCommand ' -p ' depToolboxes{i}];
end
end
tic(); tic();
fprintf('\nMATLAB Compiling: %s...\n', 'LEVer'); fprintf('\nMATLAB Compiling: %s...\n', 'LEVer');
!mcc -R -startmsg -m LEVer.m -a LEVER_logo.tif -a +Helper\GetVersion.m -a +Helper\VersionInfo.m % !mcc -R -startmsg -m LEVer.m -a LEVER_logo.tif -a +Helper\GetVersion.m -a +Helper\VersionInfo.m
system(['mcc -v -R -startmsg -m LEVer.m ' toolboxAddCommand ' -a LEVER_logo.tif -a +Helper\GetVersion.m -a +Helper\VersionInfo.m']);
fprintf('Done (%f sec)\n', toc()); fprintf('Done (%f sec)\n', toc());
tic(); tic();
......
function toolboxes = GetToolboxDependencies()
curDir = pwd();
[localNames localFileNames] = getLocalNames(curDir, '');
[list, builtins, classes, prob_files, prob_sym, eval_strings, called_from, java_classes] = depfun(localFileNames, '-toponly', '-quiet');
toolboxes = {};
for i=1:length(list)
toolboxPattern = '(?<=^.+[\\/]toolbox[\\/])[^\\/]+';
matchToolbox = regexp(list{i}, toolboxPattern, 'match', 'once');
if ( isempty(matchToolbox) )
continue;
end
if ( any(strcmpi(matchToolbox,toolboxes)) )
continue;
end
toolboxes = [toolboxes; {matchToolbox}];
end
end
function [checkNames fullNames] = getLocalNames(dirName, packageString)
matlabFiles = what(dirName);
funcFileNames = vertcat(matlabFiles.m);
funcFileNames = [funcFileNames; vertcat(matlabFiles.mex)];
checkNames = cellfun(@splitFName, funcFileNames, 'UniformOutput',0);
checkNames = cellfun(@(x)([packageString x]), checkNames, 'UniformOutput',0);
fullNames = cellfun(@(x)(fullfile(dirName,x)), funcFileNames, 'UniformOutput',0);
for i=1:length(matlabFiles.packages)
nextPackageString = makePackageString(packageString, matlabFiles.packages{i});
[pckgCheckNames pckgFullNames] = getLocalNames(fullfile(dirName, ['+' matlabFiles.packages{i}]), nextPackageString);
checkNames = [checkNames; pckgCheckNames];
fullNames = [fullNames; pckgFullNames];
end
end
function packageString = makePackageString(packageString, nextPackage)
if ( isempty(packageString) )
packageString = [nextPackage '.'];
return;
end
packageString = [packageString nextPackage '.'];
end
function name = splitFName(fileName)
[path, name] = fileparts(fileName);
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment