function varargout = webAppArchive(varargin)
%COMPILER.BUILD.WEBAPPARCHIVE  Create an archive for deployment to MATLAB Web App Server
%
%    COMPILER.BUILD.WEBAPPARCHIVE(APPFILE) creates a web app archive using
%        APPFILE.
%
%    COMPILER.BUILD.WEBAPPARCHIVE(APPFILE,NAME,VALUE) creates a web app
%        archive using APPFILE. The application can be customized using
%        optional name-value pairs.
%
%    COMPILER.BUILD.WEBAPPARCHIVE(OPTS) creates a web app archive with
%        options specified by a WebAppArchiveOptions object OPTS. When
%        specifying an options object, you cannot specify any other options
%        using name-value pairs.
%
%    RESULTS = COMPILER.BUILD.WEBAPPARCHIVE(...) returns a
%        compiler.build.Results object.
%
%    INPUT ARGUMENTS:
%
%    - APPFILE (A row char vector or a string scalar)
%        Path to a MATLAB app. It must be an mlapp file.
%
%    - OPTS (A scalar compiler.build.WebAppArchiveOptions object)
%        Web app options, specified as a WebAppArchiveOptions object.
%
%    OUTPUT ARGUMENTS:
%
%    - RESULTS (A scalar compiler.build.Results object)
%        A data object describing the MATLAB Compiler build results.
%
%    NAME-VALUE PAIR ARGUMENTS:
%
%    - AdditionalFiles (A row char vector, a string vector, or a cellstr vector)
%        A list of files and folders to be included within the web app
%        archive.
%
%    - ArchiveName (A row char vector or a string scalar)
%        Name of the generated archive.
%
%    - AutoDetectDataFiles ('on'/'off', true/false, or 1/0)
%        Binary value controlling whether data files that are provided as
%        inputs to certain functions (such as load) are automatically
%        included with the web app archive. This is set to 'on' by default.
%        If it is set to false/'off'/0, all data files must be added to the
%        application using the AdditionalFiles property.
%
%    - ObfuscateArchive ('on'/'off', true/false, or 1/0)
%        Binary value controlling whether to obfuscate the folder structures, 
%        file names and .m files in the deployable archive (.ctf file). 
%        This is set to 'off' by default.
%
%    - OutputDir (A row char vector or a string scalar)
%        Path to folder where the build files are saved.
%
%    - SupportPackages (A row char vector, a string vector, or a cellstr vector)
%        'autodetect' (default) - The required support packages are
%        detected and included automatically.
%
%        'none' - No support packages are included in the archive.
%
%        Otherwise, a specific list of support packages may be specified
%        for inclusion.
%
%    - Verbose ('on'/'off', true/false, or 1/0)
%        Binary value controlling build verbosity. It is 'off' by default.
%
%    EXAMPLES:
%
%    % Create a web app archive from an existing app named 'example.mlapp'.
%    buildResults = COMPILER.BUILD.WEBAPPARCHIVE('example.mlapp');
%
%    % Customize a web app archive using name-value pairs.
%    buildResults = COMPILER.BUILD.WEBAPPARCHIVE('example.mlapp', ...
%        'OutputDir','C:\Path\To\My\Build\Dir', ...
%        'Verbose','on');
%
%    % Customize a web app archive using a WebAppArchiveOptions object.
%    opts = compiler.build.WebAppArchiveOptions('example.mlapp');
%    opts.OutputDir = 'C:\Path\To\My\Build\Dir';
%    opts.Verbose = 'on';
%    buildResults = COMPILER.BUILD.WEBAPPARCHIVE(opts);
%
%    See also compiler.build.WebAppArchiveOptions, compiler.build.Results

%   Copyright 2020-2022 The MathWorks, Inc.

narginchk(1,2*numel(properties(compiler.build.WebAppArchiveOptions.empty))-1)
nargoutchk(0,1)

builder = compiler.internal.build.builder.WebAppArchive(varargin{:});
resultsobj = builder.build;

if nargout
    varargout{1} = resultsobj;
end
