function hadoopCompiler(varargin)

%HADOOPCOMPILER Hadoop Compiler app
%
%    This function will start the Hadoop Compiler. You can create, build
%    and package Hadoop deployment projects using the Hadoop Compiler app.
%
%    USAGE:
%    hadoopCompiler will start the app with an empty Hadoop MapReduce project.
%
%    hadoopCompiler 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, libraryCompiler, mcc, mbuild, productionServerCompiler

% Copyright 2014 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.startMapReduceTool();
    else
        com.mathworks.toolbox.compiler.plugin.DeploytoolCommandLineParser.parse(varargin, pwd);
    end
end
 
 
function str=usage()
    str=evalc(['help ' mfilename]);