Skip to content

Commit ae0f27b

Browse files
committed
buildfile: don't import to allow older matlab
1 parent 38e74aa commit ae0f27b

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

buildfile.m

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
function plan = buildfile
22
import matlab.unittest.selectors.HasTag
3-
import matlab.buildtool.tasks.TestTask
4-
import matlabtest.plugins.codecoverage.StandaloneReport
5-
6-
assert(~isMATLABReleaseOlderThan("R2022b"), "MATLAB R2022b or newer is required for this buildfile")
73

84
plan = buildplan(localfunctions);
95

106
if isMATLABReleaseOlderThan("R2023b")
11-
plan("clean") =matlab.buildtool.Task();
7+
plan("clean") = matlab.buildtool.Task();
128
else
139
plan("clean") = matlab.buildtool.tasks.CleanTask;
1410
end
@@ -30,7 +26,7 @@
3026
if isMATLABReleaseOlderThan("R2023b")
3127
plan("test_exe") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, HasTag("exe")), Dependencies="exe");
3228
elseif isMATLABReleaseOlderThan("R2024b")
33-
plan("test_exe") = TestTask(test_root, Tag="exe", Dependencies="exe");
29+
plan("test_exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Dependencies="exe");
3430
end
3531

3632
if isMATLABReleaseOlderThan("R2024b")
@@ -42,43 +38,43 @@
4238
elseif isMATLABReleaseOlderThan("R2025a")
4339
% Matlab == R2024b
4440
plan("test:java") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cjava));
45-
plan("test:exe") = TestTask(test_root, Tag="exe", Dependencies="exe");
41+
plan("test:exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Dependencies="exe");
4642
plan("test:nomex") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cnomex), Dependencies="clean");
4743
plan("test:mex") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cmex), Dependencies="mex");
4844

4945
else
5046
% Matlab >= R2025a
51-
plan("test:exe") = TestTask(test_root, Tag="exe", Description="test subprocess",...
47+
plan("test:exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Description="test subprocess",...
5248
SourceFiles=[pkg_root, test_root + ["/*.cpp", "/*.c", "/*.f90"]], ...
5349
RunOnlyImpactedTests=true,...
5450
Dependencies="exe", TestResults="TestResults_exe.xml", Strict=true);
5551

56-
plan("test:nomex") = TestTask(test_root, Description="Test non-MEX targets",...
52+
plan("test:nomex") = matlab.buildtool.tasks.TestTask(test_root, Description="Test non-MEX targets",...
5753
Selector=cnomex, ...
5854
SourceFiles=pkg_root, RunOnlyImpactedTests=true,...
5955
dependencies="clean_mex", TestResults="TestResults_nomex.xml", Strict=true);
6056

61-
plan("test:mex") = TestTask(test_root, Description="Test mex targts",...
57+
plan("test:mex") = matlab.buildtool.tasks.TestTask(test_root, Description="Test mex targts",...
6258
Selector=cmex, ...
6359
SourceFiles=[pkg_root, plan.RootFolder + "/src"], RunOnlyImpactedTests=true,...
6460
Dependencies="mex", TestResults="TestResults_mex.xml", Strict=true);
6561

66-
plan("test:java") = TestTask(test_root, Description="test Java targets", ...
62+
plan("test:java") = matlab.buildtool.tasks.TestTask(test_root, Description="test Java targets", ...
6763
Selector=cjava, ...
6864
SourceFiles=pkg_root, RunOnlyImpactedTests=true,...
6965
TestResults="TestResults_java.xml", Strict=true);
7066

71-
plan("test:python") = TestTask(test_root, Description="test Python targets", ...
67+
plan("test:python") = matlab.buildtool.tasks.TestTask(test_root, Description="test Python targets", ...
7268
Tag="python", ...
7369
SourceFiles=pkg_root, RunOnlyImpactedTests=true,...
7470
TestResults="TestResults_python.xml", Strict=true);
7571

76-
plan("coverage") = TestTask(test_root, ...
72+
plan("coverage") = matlab.buildtool.tasks.TestTask(test_root, ...
7773
Description="code coverage", ...
7874
Dependencies=["clean_mex", "exe"], ...
7975
SourceFiles=pkg_root, ...
8076
Selector=cnomex | HasTag("java") | HasTag("exe") | HasTag("python"), ...
81-
Strict=false).addCodeCoverage(StandaloneReport("coverage-report.html"));
77+
Strict=false).addCodeCoverage(matlabtest.plugins.codecoverage.StandaloneReport("coverage-report.html"));
8278

8379
plan("clean_mex") = matlab.buildtool.Task(Actions=@clean_mex, Description="Clean only MEX files to enable incremental tests");
8480
end

0 commit comments

Comments
 (0)