function varargout = standaloneApplication(varargin)
%COMPILER.BUILD.STANDALONEAPPLICATION  Create a standalone application for deployment outside of MATLAB
%
%    COMPILER.BUILD.STANDALONEAPPLICATION(APPFILE) creates a deployable
%        standalone application using APPFILE.
%
%    COMPILER.BUILD.STANDALONEAPPLICATION(APPFILE,NAME,VALUE) creates a
%        deployable standalone application using APPFILE. The application
%        can be customized using optional name-value pairs.
%
%    COMPILER.BUILD.STANDALONEAPPLICATION(OPTS) creates the standalone
%        application with options specified by a
%        StandaloneApplicationOptions object OPTS. If you use a
%        StandaloneApplicationOptions object, you cannot specify any other
%        options using name-value pairs.
%
%    RESULTS = COMPILER.BUILD.STANDALONEAPPLICATION(...) returns a
%        compiler.build.Results object.
%
%    INPUT ARGUMENTS:
%
%    - APPFILE (A row char vector or a string scalar)
%        Path to a MATLAB function, MATLAB class, or MATLAB app. The file
%        must have one of the following extensions: .m, .p, .mlx, .mlapp,
%        or any valid MEX file.
%
%    - OPTS (A scalar compiler.build.StandaloneApplicationOptions object)
%        Standalone options, specified as a StandaloneApplicationOptions
%        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 standalone
%        application.
%
%    - 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 standalone application. 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.
%
%    - CustomHelpTextFile (A row char vector or a string scalar)
%        Path to a text file containing help text for the end user of the
%        application.
%
%    - EmbedArchive ('on'/'off', true/false, or 1/0)
%        Binary value controlling whether the standalone archive is
%        embedded into the standalone executable, or if it is generated as
%        a separate file. This is set to 'on' by default.
%
%    - ExecutableIcon (A row char vector or a string scalar)
%        Path to an image file used as the icon for the standalone
%        application.
%
%    - ExecutableName (A row char vector or a string scalar)
%        Name of the generated executable.
%
%    - ExecutableSplashScreen (A row char vector or a string scalar)
%        Path to an image file used as the splash screen for the standalone
%        application. The splash screen will be resized to 400 pixels by
%        400 pixels.
%
%    - ExecutableVersion (A row char vector or a string scalar)
%        Version of the generated executable. Not used on Linux.
%
%    - 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 standalone
%        application.
%
%        Otherwise, a specific list of support packages may be specified
%        for inclusion.
%
%    - TreatInputsAsNumeric ('on'/'off', true/false, or 1/0)
%        Binary value controlling how the application treats command line
%        inputs. This is set to 'off' by default. By setting the value to
%        true/'on'/1, command line inputs will be treated as numeric
%        values.
%
%    - Verbose ('on'/'off', true/false, or 1/0)
%        Binary value controlling build verbosity. It is 'off' by default.
%
%    EXAMPLES:
%
%    % Create a standalone application from an existing file named 'mymagic.m'.
%    buildResults = COMPILER.BUILD.STANDALONEAPPLICATION('mymagic.m');
%
%    % Customize a standalone application using name-value pairs.
%    buildResults = COMPILER.BUILD.STANDALONEAPPLICATION('mymagic.m', ...
%        'CustomHelpTextFile','C:\Path\To\My\Help.txt', ...
%        'Verbose','on');
%
%    % Customize a standalone application using a StandaloneApplicationOptions object.
%    opts = compiler.build.StandaloneApplicationOptions('mymagic.m');
%    opts.CustomHelpTextFile = 'C:\Path\To\My\Help.txt';
%    opts.Verbose = 'on';
%    buildResults = COMPILER.BUILD.STANDALONEAPPLICATION(opts);
%
%    See also compiler.build.StandaloneApplicationOptions, compiler.build.Results, mcc

%   Copyright 2020-2022 The MathWorks, Inc.

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

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

if nargout
    varargout{1} = resultsobj;
end
