Skip to content

Commit 75868aa

Browse files
authored
documenting MATLAB startup options (#32)
* addressing editorial feedback
1 parent 2bc974b commit 75868aa

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

CONFIGDOC.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ To define MATLAB as an agent-specific executable capability, local server execut
2828

2929
| Platform | Path to MATLAB Root Folder |
3030
|--------------|---------------------------------|
31-
| Windows® | C:\Program Files\MATLAB\R2023a |
32-
| Linux® | /usr/local/MATLAB/R2023a |
33-
| macOS | /Applications/MATLAB_R2023a.app |
31+
| Windows® | C:\Program Files\MATLAB\R2023b |
32+
| Linux® | /usr/local/MATLAB/R2023b |
33+
| macOS | /Applications/MATLAB_R2023b.app |
3434

35-
This figure shows an example of how to define MATLAB R2023a as an agent-specific executable capability for a Windows agent.
35+
This figure shows an example of how to define MATLAB R2023b as an agent-specific executable capability for a Windows agent.
3636

37-
![executable_capability](https://user-images.githubusercontent.com/48831250/229811802-c0fc2331-f704-4e5e-b24d-c1361494903a.png)
37+
![executable_capability](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/86b42194-bb3e-44f7-aad2-b75f2ecd0c91)
3838

3939

4040
For more information on how to define executables in Bamboo, see [Defining a new executable capability](https://confluence.atlassian.com/bamboo/defining-a-new-executable-capability-289277164.html).
@@ -48,12 +48,16 @@ The plugin provides you with three tasks:
4848

4949
When you add a task to your plan, you must specify a MATLAB executable for it. To specify a MATLAB executable for a task, if your preferred MATLAB version is already defined as an executable capability, select it from the **Executable** list in the task configuration interface. Otherwise, click the **Add new executable** link to specify an executable label and the full path to the MATLAB root folder.
5050

51+
You can specify optional startup options for a MATLAB executable by first selecting **Specify startup options** and then populating the **Options** box in the task configuration interface. For example, specify `-nojvm` to start MATLAB without the JVM™ software. If you specify more than one startup option, use a space to separate them (for example, `-nojvm -logfile "output.log"`). For more information about MATLAB startup options, see [Commonly Used Startup Options](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html).
52+
53+
> :information_source: **Note:** Using the **Options** box to specify the `-batch` or `-r` option is not supported.
54+
5155
### Run MATLAB Build
5256
The **Run MATLAB Build** task enables you to run a build using the [MATLAB build tool](https://www.mathworks.com/help/matlab/matlab_prog/overview-of-matlab-build-tool.html). You can use this task to run the MATLAB build tasks specified in a file named `buildfile.m` in the root of your repository. To use the **Run MATLAB Build** task, you need MATLAB R2022b or a later release.
5357

54-
To configure the **Run MATLAB Build** task, first specify the MATLAB executable to use for the task. Then, specify the MATLAB build tasks you want to execute in the **Build tasks** box. If you specify more than one task, use a space to separate them. If you do not specify any tasks, the plugin runs the default tasks in `buildfile.m` as well as all the tasks on which they depend. For example, use MATLAB R2023a to run a task named `mytask` as well as all the tasks on which it depends.
58+
To configure the **Run MATLAB Build** task, first specify the MATLAB executable and optional startup options to use for the task. Then, specify the MATLAB build tasks you want to execute in the **Build tasks** box. If you specify more than one task, use a space to separate them. If you do not specify any tasks, the plugin runs the default tasks in `buildfile.m` as well as all the tasks on which they depend. For example, use MATLAB R2023b to run a task named `mytask` as well as all the tasks on which it depends.
5559

56-
![run_matlab_build](https://user-images.githubusercontent.com/48831250/229813156-b06b4a15-a1fd-4dfe-9031-17740f6ef318.png)
60+
![run_matlab_build](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/de110406-170c-4e10-a3ec-269862cdb8eb)
5761

5862
MATLAB exits with exit code 0 if the build runs successfully. Otherwise, MATLAB terminates with a nonzero exit code, which causes the Bamboo build to fail.
5963

@@ -62,9 +66,9 @@ When you use this task, a file named `buildfile.m` must be in the root of your r
6266
### Run MATLAB Tests
6367
The **Run MATLAB Tests** task enables you to run MATLAB and Simulink tests and generate artifacts such as JUnit-style test results and HTML coverage reports. By default, the plugin includes any test files in your [MATLAB project](https://www.mathworks.com/help/matlab/projects.html) that have a `Test` label. If your plan does not use a MATLAB project, or if it uses a MATLAB release before R2019a, then the plugin includes all tests in the root of your repository and in any of its subfolders. The Bamboo build fails if any of the included tests fails.
6468

65-
To configure the **Run MATLAB Tests** task, specify the MATLAB executable to use for the task. For example, use MATLAB R2023a to run the tests in your MATLAB project.
69+
To configure the **Run MATLAB Tests** task, specify the MATLAB executable and optional startup options to use for the task. For example, use MATLAB R2023b to run the tests in your MATLAB project.
6670

67-
![run_matlab_tests](https://user-images.githubusercontent.com/48831250/229815054-58492339-59f1-402b-9b69-22c9552492cb.png)
71+
![run_matlab_tests](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/2cf0f227-9aa0-4851-bdff-8a6c59d0a846)
6872

6973
You can customize the **Run MATLAB Tests** task by selecting options in the task configuration interface. For example, you can add source folders to the MATLAB search path, control which tests to run, and generate various test and coverage artifacts. If you do not select any of the existing options, all the tests in your project run, and any test failure causes the build to fail.
7074

@@ -113,13 +117,13 @@ Artifacts to generate with the plugin are subject to these restrictions:
113117
### Run MATLAB Command
114118
The **Run MATLAB Command** task enables you to run MATLAB scripts, functions, and statements. You can use this task to customize your test run or add a step in MATLAB to your plan.
115119

116-
To configure the **Run MATLAB Command** task, first specify the MATLAB executable to use for the task. Then, specify the MATLAB script, function, or statement you want to execute in the **Command** box. If you specify more than one script, function, or statement, use a comma or semicolon to separate them. If you want to run a script or function, do not specify the file extension. For example, use MATLAB R2023a to run a script named `myscript.m` in the root of your repository.
120+
To configure the **Run MATLAB Command** task, first specify the MATLAB executable and optional startup options to use for the task. Then, specify the MATLAB script, function, or statement you want to execute in the **Command** box. If you specify more than one script, function, or statement, use a comma or semicolon to separate them. If you want to run a script or function, do not specify the file extension. For example, use MATLAB R2023b to run a script named `myscript.m` located in the root of your repository.
117121

118-
![run_matlab_command](https://user-images.githubusercontent.com/48831250/229817962-2181df1d-8aee-465d-b840-b6f71ded3abd.png)
122+
![run_matlab_command](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/8d371668-2e45-467d-98ad-b9310df244c0)
119123

120-
MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the Bamboo build to fail. To fail the build in certain conditions, use the [`assert`](https://www.mathworks.com/help/matlab/ref/assert.html) or [`error`](https://www.mathworks.com/help/matlab/ref/error.html) functions.
124+
MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the Bamboo build to fail. To fail the build in certain conditions, use the [`assert`](https://www.mathworks.com/help/matlab/ref/assert.html) or [`error`](https://www.mathworks.com/help/matlab/ref/error.html) function.
121125

122-
When you use this task, all of the required files must be on the MATLAB search path. If your script or function is not in the root of your repository, you can use the [`addpath`](https://www.mathworks.com/help/matlab/ref/addpath.html), [`cd`](https://www.mathworks.com/help/matlab/ref/cd.html), or [`run`](https://www.mathworks.com/help/matlab/ref/run.html) functions to ensure that it is on the path when invoked. For example, to run `myscript.m` in a folder named `myfolder` located in the root of the repository, you can specify the contents of the **Command** box like this:
126+
When you use this task, all of the required files must be on the MATLAB search path. If your script or function is not in the root of your repository, you can use the [`addpath`](https://www.mathworks.com/help/matlab/ref/addpath.html), [`cd`](https://www.mathworks.com/help/matlab/ref/cd.html), or [`run`](https://www.mathworks.com/help/matlab/ref/run.html) function to ensure that it is on the path when invoked. For example, to run `myscript.m` in a folder named `myfolder` located in the root of the repository, you can specify the contents of the **Command** box like this:
123127

124128
`addpath("myfolder"), myscript`
125129

examples/Run-MATLAB-Tests.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This example shows how to run a suite of MATLAB® unit tests with Bamboo®
66
* Define a task in the plan to run the tests and generate test and coverage artifacts.
77
* Build the plan and examine the test results and the generated artifacts.
88

9-
The build runs the tests in the Times Table App MATLAB project (which requires R2019a or later). You can create a working copy of the project files and open the project in MATLAB by running this statement in the Command Window.
9+
The build runs the tests in the Times Table App MATLAB project (which requires R2019a or later). You can create a working copy of the project files and open the project in MATLAB by running a statement in the Command Window. The statement to run depends on your MATLAB release:
1010

11-
```
12-
matlab.project.example.timesTable
13-
```
11+
R2023a and Earlier | Starting in R2023b
12+
-----------------------------------| ------------------------------------------------
13+
`matlab.project.example.timesTable`| `openExample("matlab/TimesTableProjectExample")`
1414

15-
For more information about the Times Table App example project, see [Explore an Example Project](https://www.mathworks.com/help/matlab/matlab_prog/explore-an-example-project.html).
15+
For more information about the Times Table App project, see [Explore an Example Project](https://www.mathworks.com/help/matlab/matlab_prog/explore-an-example-project.html).
1616

1717
## Prerequisites
1818
To follow the steps in this example:
@@ -25,29 +25,27 @@ Create a new build plan and configure it by following these steps:
2525

2626
1. In your build dashboard, from the top menu bar, select **Create > Create plan**. Then, on the **Configure plan** page, specify your build plan details.
2727

28-
![configure_plan_details](https://user-images.githubusercontent.com/48831250/200667816-08ba3b1a-418e-4b7c-83a6-fdbce623a2a1.png)
28+
![configure_plan_details](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/b49c77e2-bfef-4f67-9742-ec7a1731709a)
2929

3030
2. On the **Configure plan** page, in the **Link repository to new build plan** section, specify the repository for your build plan.
3131

32-
![configure_plan_repository](https://user-images.githubusercontent.com/48831250/200669112-d41d8b12-65cf-4d2a-8bf8-9bf49a1a2a6f.png)
32+
![configure_plan_repository](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/aadb6635-d309-47b8-a77e-1dbc6b36ab95)
3333

3434
3. To confirm your plan details, click **Configure plan**. A new page opens that lets you add tasks to the default job of your plan. By default, Bamboo includes the **Source Code Checkout** task, which is responsible for checking out code from your repository.
3535

3636
4. To run MATLAB tests as part of your build, add the **Run MATLAB Tests** task by clicking **Add task** and then selecting **Run MATLAB Tests** from the **Task types** interface. You can access the task by typing `MATLAB` in the text box located at the upper-right corner of the interface.
3737

38-
![add_task](https://user-images.githubusercontent.com/48831250/200669849-074b86a1-2459-4ed8-8c18-1e13cd36bb0a.png)
38+
![add_task](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/8e8f8822-5214-4232-95ad-96305a93f240)
3939

40-
5. In the **Run MATLAB Tests** task configuration interface, from the **Executable** list, select the MATLAB release to use for the task. Then, specify the artifacts to generate in the working directory. In this example, the plugin uses MATLAB R2023a to run the tests and generate JUnit-style test results, a PDF test report, and an HTML code coverage report. For more information about the tasks provided by the plugin, see [Plugin Configuration Guide](../CONFIGDOC.md).
40+
5. In the **Run MATLAB Tests** task configuration interface, from the **Executable** list, select the MATLAB release to use for the task. Then, specify the artifacts to generate in the working directory. In this example, the plugin uses MATLAB R2023b to run the tests and generate JUnit-style test results, a PDF test report, and an HTML code coverage report. For more information about the tasks provided by the plugin, see [Plugin Configuration Guide](../CONFIGDOC.md).
4141

42-
![run_matlab_tests](https://user-images.githubusercontent.com/48831250/230393980-2c59701f-7b39-4feb-84d3-70bf3b404dc3.png)
42+
![run_matlab_tests](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/ee004c22-f76b-40a4-95a4-ebd2ae53147c)
4343

4444
6. To publish the JUnit-style test results, add the [JUnit Parser](https://confluence.atlassian.com/bamboo/junit-parser-289277056.html) task to your job. To make sure that the task runs regardless of the build status, specify it as a final task.
4545

46-
Once you have added the required tasks for your build, click **Save and continue**.
47-
48-
7. Create artifact definitions for the artifacts you want to access from the build dashboard. To create artifact definitions, click **Default Job**, and select the **Artifacts** tab on the page that opens. Then, for each artifact, click **Create artifact** and specify the required values.
46+
7. Create artifact definitions for the artifacts you want to access from the build dashboard. To create artifact definitions, select the **Artifacts** tab. Then, for each artifact, click **Create artifact** and specify the required values.
4947

50-
![artifact_definitions](https://user-images.githubusercontent.com/48831250/200671311-70b084ca-d401-43a3-ba6e-b9d0cdf66695.png)
48+
![artifact_definitions](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/101ea68c-f58c-42d4-bf9e-72b7d2f7df90)
5149

5250
## Run Tests and Inspect Artifacts
5351
Now that your plan configuration is complete, you can run your plan.
@@ -60,7 +58,7 @@ Bamboo triggers a build, runs it, and displays a green or red bar to indicate it
6058

6159
To access the test and coverage artifacts, select the **Tests** and **Artifacts** tabs. For example, select the **Artifacts** tab to access the generated HTML code coverage and PDF test reports.
6260

63-
![build_outcome](https://user-images.githubusercontent.com/48831250/200681811-1119e3a7-07c5-49c2-a6c8-31c2a1c02cd4.png)
61+
![build_outcome](https://github.com/mw-hrastega/Times-Table-App/assets/48831250/1ad34ab5-ff51-424f-bed6-17ea7d681c87)
6462

6563
## See Also
6664
* [Plugin Configuration Guide](../CONFIGDOC.md)<br/>

0 commit comments

Comments
 (0)