compiler.build.ProductionServerArchiveOptions

Create a deployable archive options object

Description

example

opts = compiler.build.ProductionServerArchiveOptions(functionfiles) creates a ProductionServerArchiveOptions object using the MATLAB® functions specified by functionfiles. The ProductionServerArchiveOptions object is passed as an input to the compiler.build.productionServerArchive (MATLAB Production Server) function.

example

opts = compiler.build.ProductionServerArchiveOptions(functionfiles,Name,Value) creates a ProductionServerArchiveOptions object using functionfiles. The archive can be customized using optional name-value pairs.

Examples

collapse all

Create a ProductionServerArchiveOptions object on a Windows® system from a function file named example.m.

opts = compiler.build.ProductionServerArchiveOptions('example.m')
opts = 

  ProductionServerArchiveOptions with properties:

            ArchiveName: 'example'
          FunctionFiles: {'D:\Documents\MATLAB\work\example.m'}
     FunctionSignatures: ''
        AdditionalFiles: {}
    AutoDetectDataFiles: on
              OutputDir: '.\exampleproductionServerArchive'
                Verbose: off

You can modify property values of an existing ProductionServerArchiveOptions object using dot notation.

opts.Verbose = 'on'
opts =

  ProductionServerArchiveOptions with properties:

            ArchiveName: 'example'
          FunctionFiles: {'D:\Documents\MATLAB\work\example.m'}
     FunctionSignatures: ''
        AdditionalFiles: {}
    AutoDetectDataFiles: on
              OutputDir: '.\exampleproductionServerArchive'
                Verbose: on

Build a production server archive using the compiler.build.productionServerArchive command.

compiler.build.productionServerArchive(opts);

Create a ProductionServerArchiveOptions object on a Windows system from the function files myfunc1.m and myfunc2.m.

opts = compiler.build.ProductionServerArchiveOptions(["myfunc1.m","myfunc2.m"],...
    'ArchiveName','MyServerApp',...
    'OutputDir','D:\Documents\MATLAB\work\ProductionServer\',...
    'AutoDetectDataFiles','off')
opts = 

  ProductionServerArchiveOptions with properties:

            ArchiveName: 'MyServerApp'
          FunctionFiles: {2×1 cell}
     FunctionSignatures: ''
        AdditionalFiles: {}
    AutoDetectDataFiles: off
              OutputDir: 'D:\Documents\MATLAB\work\ProductionServer\'
                Verbose: off

Input Arguments

collapse all

List of files implementing MATLAB functions, specified as a character vector, a string scalar, a string array, or a cell array of character vectors. Files must have a .m extension.

Example: {'myProductionServerFunction.m','mySubFunction.m'}

Data Types: char | string | cell

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Verbose','on'

Name of the generated production server archive, specified as a character vector or a string scalar. The default value is the first file listed in the functionfiles argument.

Example: 'ArchiveName','MyMagic'

Data Types: char | string

Automatically include data files, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • If you set this property to 'on', then data files that are provided as inputs to certain functions (load, fopen, etc) are automatically included with the production server archive.

  • If you set this property to 'off', then data files must be added to the production server archive using the AdditionalFiles property.

Example: 'AutoDetectDataFiles','Off'

Data Types: logical

Path to a JSON file that details the signatures of all functions listed in functionfiles. For information on how to specify function signatures, see MATLAB Function Signatures in JSON (MATLAB Production Server).

Example: 'FunctionSignatures','D:\Documents\MATLAB\work\magicapp\signatures.json'

Data Types: char | string

Path to the folder where the production server archive files are saved, specified as a character vector or a string scalar. The path can be relative to the current working directory or absolute.

If no path is specified, a build folder is created in the current working directory with the name ArchiveNameproductionServerArchive.

Example: 'OutputDir','D:\Documents\MATLAB\work\MyMagicproductionServerArchive'

Build verbosity, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • If you set this property to 'on', then the MATLAB Command Window displays progress information indicating code generation stages and compiler output during the build process.

  • If you set this property to 'off', then the command window does not display progress information.

Example: 'Verbose','Off'

Data Types: logical

Output Arguments

collapse all

Production server archive build options, returned as a ProductionServerArchiveOptions object.

Introduced in R2020b