function libraryCompiler(varargin)

%LIBRARYCOMPILER Library Compiler app
%
%    This function will start the Library Compiler. You can create, build
%    and package library deployment projects using the Library Compiler app.
%
%    USAGE:
%    libraryCompiler will start the app with an empty Library
%    Compiler project.
%
%    libraryCompiler projectname will open an existing project in the
%    app. If the project does not exist, an error will be generated and the
%    program will exit.
%
%    See also applicationCompiler, deploytool, hadoopCompiler, mcc, mbuild, productionServerCompiler

% Copyright 2013 MathWorks, Inc.

[a,~]=license('checkout','Compiler');
if( ~a )
    error(message('Compiler:deploytool:license_checkout_error'));
end
 
if (nargin == 1 && (strcmp(varargin{1}, '-?') || strcmp(varargin{1}, '/?')))
    disp(usage());
    return;
else
    com.mathworks.project.impl.plugin.PluginManager.allowMatlabThreadUse();
    if nargin == 0
        com.mathworks.toolbox.compiler.desktop.DeploytoolLaunchPad.startLibraryTool;
    else
        com.mathworks.toolbox.compiler.plugin.DeploytoolCommandLineParser.parse(varargin, pwd);
    end
end
 
 
function str=usage()
    str=evalc(['help ' mfilename]);