Skip to content

Commit

Permalink
Minor cleanup on toolbox generation script
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Oct 2, 2023
1 parent f102c27 commit 2656b76
Showing 1 changed file with 7 additions and 40 deletions.
47 changes: 7 additions & 40 deletions CI/scripts/genTlbx.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ function genTlbx(examples)
v = adi.Version;
uuid = matlab.lang.internal.uuid;

%% Unpack verilog source
if ~examples
cd('../../');
cd('hdl/vendor/AnalogDevices/vivado');
!find -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \;
!find . -name "*.zip" -type f -delete
cd('../../../..');
cd('CI/scripts');
end

%%
cd(fileparts((mfilename('fullpath'))));
cd('../..');
Expand Down Expand Up @@ -60,6 +50,13 @@ function genTlbx(examples)
ps = [ps(:)',{'hdl'}];
end

% Check for deps
if ~isfolder('deps')
error('deps folder with libad9361 not available')
else
ps = [ps(:)',{'deps'}];
end

paths = '';
for p = ps
pp = genpath(p{:});
Expand All @@ -79,36 +76,6 @@ function genTlbx(examples)
end
matlab.addons.toolbox.packageToolbox(projectFile,outputFile)

if ~usejava('desktop')
%% Update toolbox paths
mkdir other
movefile([outputFile,'.mltbx'], ['other/',outputFile,'.zip']);
cd other
unzip([outputFile,'.zip'],'out');
cd('out')
cd('metadata');
fid = fopen('configuration.xml','r');
f=fread(fid,'*char')';
fclose(fid);

s = '</matlabPaths>';
sections = strsplit(f,s);
s1 = sections{1};
s2 = sections{2};
newfile = [s1,paths,s,s2];

fid = fopen('configuration.xml','w');
fprintf(fid,'%s',newfile);
fclose(fid);

%% Repack
cd('..');
zip([outputFile,'.zip'], '*');
movefile([outputFile,'.zip'],['../../',outputFile,'.mltbx']);
cd('../..');
rmdir('other','s');
end

delete bsp.prj


Expand Down

0 comments on commit 2656b76

Please sign in to comment.