-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildfile.m
40 lines (29 loc) · 1.45 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
function plan = buildfile()
% BUILDFILE File invoked by automated build.
project = matlab.project.currentProject();
if isempty(project) || ~isequal(project.Name, "MAG Data Visualization")
project = matlab.project.loadProject("MAGDataVisualization.prj");
restore = onCleanup(@() project.close());
end
% Create a plan from task functions.
plan = buildplan();
% Add the "check" task to identify code issues.
sourceFolders = ["app", "src"];
plan("check") = matlab.buildtool.tasks.CodeIssuesTask(sourceFolders, ...
IncludeSubfolders = true);
% Add the "test" task to run tests.
testFolders = ["tests/system", "tests/unit"];
plan("test") = matlab.buildtool.tasks.TestTask(testFolders, ...
SourceFiles = [sourceFolders, "tests/tool"], ...
IncludeSubfolders = true, ...
TestResults = fullfile("artifacts/results.xml"), ...
CodeCoverageResults = fullfile("artifacts/coverage.xml"));
% Add the "package" task to create toolbox.
plan("package") = mag.buildtool.task.PackageTask(Description = "Package code into toolbox", ...
ToolboxTemplate = fullfile("resources/toolbox-template.xml"), ...
ToolboxPath = fullfile("artifacts/MAG Data Visualization.mltbx"));
% Add the "clean" task to delete output of all tasks.
plan("clean") = matlab.buildtool.tasks.CleanTask();
% Make sure tasks run by default.
plan.DefaultTasks = ["check", "test"];
end