function deploytool(varargin)

%DEPLOYTOOL MATLAB Compiler user interface
%
%    This function will start the MATLAB Compiler user interface. You can 
%    create, build and package various deployment projects using Compiler
%    apps, or you can build and package existing projects from the Command 
%    Line Interface.
%
%    USAGE:
%    DEPLOYTOOL will open a dialog for selecting a MATLAB Compiler app to
%    begin a new project in.
%
%    DEPLOYTOOL projectname will open an existing MATLAB Compiler project. 
%    If the project does not exist, an error will be generated and the 
%    program will exit.
%
%    DEPLOYTOOL -build projectname will build an existing project 
%    from the Command Line Interface.
% 
%    DEPLOYTOOL -package projectname will package an existing project from 
%    the Command Line Interface.
%
%    DEPLOYTOOL -? will display this message.
%
%    See also applicationCompiler, hadoopCompiler, libraryCompiler, mcc, mbuild, productionServerCompiler

% Copyright 1984-2015 The MathWorks, Inc.

[a,~]=license('checkout','Compiler');
if( ~a )
    error(message('Compiler:deploytool:license_checkout_error'));
end

% show help info for "deploytool -?", otherwise call Java to parse the command line.
if (nargin == 1 && (strcmp(varargin{1}, '-?') || strcmp(varargin{1}, '/?')))
    disp(usage());              
    return;
else    
    com.mathworks.project.impl.plugin.PluginManager.allowMatlabThreadUse()
    com.mathworks.toolbox.compiler.plugin.DeploytoolCommandLineParser.parse(varargin, pwd);
end

 function str=usage()
 str=evalc(['help ' mfilename]);
