-
Notifications
You must be signed in to change notification settings - Fork 222
/
createMLTBX.m
59 lines (49 loc) · 2.52 KB
/
createMLTBX.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function createMLTBX(prjFile, toolboxVersion)
% Package the toolbox as MLTBX.
% createMLTBX(prjFile, toolboxVersion) builds the MLTBX file and saves it
% in the working directory. The prjFile is the path to the toolbox packaging
% PRJ file and toolboxVersion is a string of the form Major.Minor.Bug.Build.
%
% Example
% createMLTBX("gramm.prj", "1.0.1.3")
if ~isfile(prjFile)
error("Unable to find \'%s\'.", prjFile);
end
addpath gramm/
export("gramm/doc/gramm_landing.mlx","gramm/html/gramm_landing.html",Run=true);
export("gramm/doc/GettingStarted.mlx","gramm/html/GettingStarted.html",Run=true);
export("gramm/doc/Groups.mlx","gramm/html/Groups.html",Run=true);
export("gramm/doc/TimeSeries.mlx","gramm/html/TimeSeries.html",Run=true);
export("gramm/doc/XY.mlx","gramm/html/XY.html",Run=true);
export("gramm/doc/examples.mlx","gramm/html/examples.html",Run=true);
movefile('./gramm/doc/gettingstarted_export.png','./images/gettingstarted_export.png')
movefile('./gramm/doc/groups_export.png','./images/groups_export.png')
movefile('./gramm/doc/timeseries_export.png','./images/timeseries_export.png')
movefile('./gramm/doc/xy_export.png','./images/xy_export.png')
movefile('./gramm/doc/overlaid_export.png','./images/overlaid_export.png')
movefile('./gramm/doc/layout_export.png','./images/layout_export.png')
movefile('./gramm/doc/colorlegend_export.png','./images/colorlegend_export.png')
movefile('./gramm/doc/scaling_export.png','./images/scaling_export.png')
%We need to run it again to have correctly sized figures in the html pages
export("gramm/doc/gramm_landing.mlx","gramm/html/gramm_landing.html");
export("gramm/doc/GettingStarted.mlx","gramm/html/GettingStarted.html");
export("gramm/doc/Groups.mlx","gramm/html/Groups.html");
export("gramm/doc/TimeSeries.mlx","gramm/html/TimeSeries.html");
export("gramm/doc/XY.mlx","gramm/html/XY.html");
export("gramm/doc/examples.mlx","gramm/html/examples.html");
%Remove downloaded sample data files
delete("example_data.mat")
delete("example_movement.mat")
delete("example_spectra.mat")
delete("gramm/doc/example_data.mat")
delete("gramm/doc/example_movement.mat")
delete("gramm/doc/example_spectra.mat")
packagingData = matlab.addons.toolbox.ToolboxOptions(prjFile);
% Update the version number
packagingData.ToolboxVersion = toolboxVersion;
outputFileName = packagingData.ToolboxName + "_" + packagingData.ToolboxVersion + ".mltbx";
packagingData.OutputFile =outputFileName;
% Create toolbox MLTBX
matlab.addons.toolbox.packageToolbox(packagingData);
fprintf("Created %s.\n", outputFileName);
end