From 2fd3cec97e3fda2e6ca2f52329cc2bcc4c3bba20 Mon Sep 17 00:00:00 2001 From: Bensingh Pancras Date: Tue, 2 Jun 2026 09:56:04 +0530 Subject: [PATCH 1/3] Organized the buidtasks with task groups. --- buildfile.m | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/buildfile.m b/buildfile.m index 3d15753..7bae6ab 100644 --- a/buildfile.m +++ b/buildfile.m @@ -12,31 +12,38 @@ foldersToMex = plan.files(fullfile("cpp", "*Mex")).select(@isfolder); for folder = foldersToMex.paths [~, folderName] = fileparts(folder); - plan("mex:"+folderName) = matlab.buildtool.tasks.MexTask(fullfile(folder, "**/*.cpp"), ... + plan("build:mex:"+folderName) = matlab.buildtool.tasks.MexTask(fullfile(folder, "**/*.cpp"), ... mexOutputFolder, ... Filename=folderName); end -plan("mex").Description = "Build MEX functions"; +plan("build:mex").Description = "Build MEX functions"; +plan("build").Description = "Build the toolbox"; % Define the "check" task sourceFolder = files(plan, "toolbox"); -plan("check") = matlab.buildtool.tasks.CodeIssuesTask(sourceFolder,... +plan("validate:check") = matlab.buildtool.tasks.CodeIssuesTask(sourceFolder,... IncludeSubfolders = true); % Define the "test" task testsFolder = files(plan, "tests"); -plan("test") = matlab.buildtool.tasks.TestTask(testsFolder,... +plan("validate:test") = matlab.buildtool.tasks.TestTask(testsFolder,... IncludeSubfolders = true, OutputDetail = "terse"); + +plan("validate:dependency") = matlab.buildtool.Task(); +plan("validate:dependency").Actions = @dependencyAnalysis; + +plan("validate").Description = "Validate the toolbox"; + % Make the "test" task the default task in the plan -plan.DefaultTasks = ["mex" "test"]; +plan.DefaultTasks = "build"; % Make the "release" task dependent on the "check" and "test" tasks -plan("release").Dependencies = ["mex" "check" "test"]; -plan("release").Outputs = "release\Arithmetic_Toolbox.mltbx"; +plan("package").Dependencies = ["build" "validate"]; +plan("package").Outputs = "release\Arithmetic_Toolbox.mltbx"; end -function releaseTask(~) +function packageTask(~) % Create an MLTBX package releaseFolderName = "release"; if isMATLABReleaseOlderThan("R2025a") @@ -60,4 +67,4 @@ function releaseTask(~) mkdir(releaseFolderName) end matlab.addons.toolbox.packageToolbox(opts); -end +end \ No newline at end of file From 606f88d33f3b30d1d1a8ae12abc7d68148032d39 Mon Sep 17 00:00:00 2001 From: Bensingh Pancras Date: Tue, 2 Jun 2026 10:01:19 +0530 Subject: [PATCH 2/3] Removed the dependency task from the buildfile --- buildfile.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildfile.m b/buildfile.m index 7bae6ab..66d4ffd 100644 --- a/buildfile.m +++ b/buildfile.m @@ -30,9 +30,6 @@ IncludeSubfolders = true, OutputDetail = "terse"); -plan("validate:dependency") = matlab.buildtool.Task(); -plan("validate:dependency").Actions = @dependencyAnalysis; - plan("validate").Description = "Validate the toolbox"; % Make the "test" task the default task in the plan From bc8c23e67ad2f94168b184e9f99c3c6223229c40 Mon Sep 17 00:00:00 2001 From: Bensingh Pancras Date: Tue, 2 Jun 2026 18:57:34 +0530 Subject: [PATCH 3/3] Updated the inline comments, made validate depend on build --- buildfile.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/buildfile.m b/buildfile.m index 66d4ffd..4a17437 100644 --- a/buildfile.m +++ b/buildfile.m @@ -1,4 +1,5 @@ function plan = buildfile + % Create a plan from the task functions plan = buildplan(localfunctions); @@ -19,12 +20,12 @@ plan("build:mex").Description = "Build MEX functions"; plan("build").Description = "Build the toolbox"; -% Define the "check" task +% Define the "check" task as a sub task of validate sourceFolder = files(plan, "toolbox"); plan("validate:check") = matlab.buildtool.tasks.CodeIssuesTask(sourceFolder,... IncludeSubfolders = true); -% Define the "test" task +% Define the "test" task as a sub task of validate testsFolder = files(plan, "tests"); plan("validate:test") = matlab.buildtool.tasks.TestTask(testsFolder,... IncludeSubfolders = true, OutputDetail = "terse"); @@ -32,12 +33,15 @@ plan("validate").Description = "Validate the toolbox"; -% Make the "test" task the default task in the plan +% Make "build" task group the default task plan.DefaultTasks = "build"; -% Make the "release" task dependent on the "check" and "test" tasks -plan("package").Dependencies = ["build" "validate"]; -plan("package").Outputs = "release\Arithmetic_Toolbox.mltbx"; +% Make the "validate" task dependent on "build" task group +plan("validate").Dependencies = "build"; + +% Make the "package" task dependent on "validate" task group +plan("package").Dependencies = "validate"; +plan("package").Outputs = fullfile("release","Arithmetic_Toolbox.mltbx"); end function packageTask(~)