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 compiler.package.installer, createDeploymentScript,
%    deploytool, mcc

% Copyright 2013-2022 MathWorks, Inc.

narginchk(0,2)

% Verify appropriate Compiler license
if isempty(which('productionServerCompiler'))
    status = license('checkout','Compiler');
    if ~status
        error(message('Compiler:deploytool:license_checkout_error'))
    end
else
    status = license('checkout','matlab_builder_for_java');
    if ~status
        error(message('Compiler:deploytool:license_checkout_error_sdk'))
    end
end

compiler.internal.launchui(mfilename,varargin{:})
