Main Content

Run a Project Custom Task and Publish Report

  1. On theProjecttab, click the down arrow to expand theToolsgallery. UnderProject Checks, click成本的m Tasks, and then select the check boxes of project files you want to include in the custom task.

    Tip

    If the function can identify the files to operate on, include all files. For example, the custom task functionsaveModelFilesin theairframeproject checks that the file is a Simulink®model and does nothing if it is not.

    To select multiple files,ShiftorCtrl+click, and then right-click a file and selectIncludeorExclude.

  2. Specify the custom task function to run in the成本的m taskbox. Enter the name, or clickBrowse, or choose from a list of custom tasks.

    If your project does not yet contain any custom task functions, seeCreate a Custom Task Function.

  3. ClickRun Task.

    The project displays the results.

  4. To view details of results for the currently selected file, click a file and check the Results pane.

You can publish a report of your custom task results. For example, try this custom task:

  1. Open an example project by enteringsldemo_slproject_customtasks.

  2. On theProjecttab, click the down arrow to expand theToolsgallery. UnderProject Checks, click成本的m Tasks.

  3. In the Custom Task dialog box, click the成本的m taskdrop-down arrow to choose from a list of tasks, and selectGenerate Bill of Materials Report.

  4. ClickRun Task. Results appear.

  5. ClickPublish Report.

  6. In the file browser, specify a name and location for the report, and choose a file type from HTML orMicrosoft®. If you haveMATLAB®Report Generator™, you can also choose PDF.

  7. View the results in the report.

    The example custom task functionGenerate Bill of Materials Reportcreates a list of project files, their source control status, revision numbers, and MD5 checksums. You can view the code for this custom task in the filebillOfMaterials.m.

  8. To see the report file and add it to your project, switch to theAllfiles view.

Tip

To try example custom tasks in a project, see the exampleRun Custom Tasks with a Project.

Related Topics