-
Notifications
You must be signed in to change notification settings - Fork 10
/
buildfile.m
48 lines (33 loc) · 1.47 KB
/
buildfile.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
function plan = buildfile()
plan = buildplan(localfunctions);
plan.DefaultTasks = "test";
plan("package").Dependencies = "publishDoc";
plan("publishDoc").Dependencies = "test";
plan("test").Dependencies = "check";
end
function checkTask(context)
% Temporarily add buildUtilities to the path (remove it at the end of the function)
oldPath = addpath(fullfile(context.Plan.RootFolder,"buildUtilities"));
raii = onCleanup(@()(path(oldPath)));
codecheckToolbox(context.Plan.RootFolder);
end
function testTask(context)
% Temporarily add buildUtilities to the path (remove it at the end of the function)
oldPath = addpath(fullfile(context.Plan.RootFolder,"buildUtilities"));
raii = onCleanup(@()(path(oldPath)));
testToolbox()
end
function publishDocTask(context)
% Generate HTML files
% Temporarily add buildUtilities to the path (remove it at the end of the function)
oldPath = addpath(fullfile(context.Plan.RootFolder,"buildUtilities"));
raii = onCleanup(@()(path(oldPath)));
gendocToolbox(context.Plan.RootFolder)
end
function packageTask(context)
% Package the toolbox in an MLTBX, just incrementing build. Note that GitHub action calls packageToolbox directly.
% Temporarily add buildUtilities to the path (remove it at the end of the function)
oldPath = addpath(fullfile(context.Plan.RootFolder,"buildUtilities"));
raii = onCleanup(@()(path(oldPath)));
packageToolbox("build")
end