src/CCFileCheck.js
/**
 * Instantiates a CCFileCheck object.
 *
 * @classdesc This class parses the passed arguments array and starts processing the configuration files and the
 *            corresponding file checkings whether the specified files are used in any compilation unit.
 *
 * @constructor
 *
 * @extends events.EventEmitter
 * @emits CCFileCheck#argsError
 * @emits CCFileCheck#help
 * @emits CCFileCheck#version
 * @emits CCFileCheck#configHelp
 * @emits CCFileCheck#closureHelp
 * @emits CCFileCheck#closureVersion
 * @emits CCFileCheck#argsParsed
 * @emits CCFileCheck#compilerPath
 * @emits CCFileCheck#contribPath
 * @emits CCFileCheck#configError
 * @emits CCFileCheck#circularDependencyError
 * @emits CCFileCheck#verificationSuccess
 * @emits CCFileCheck#verificationError
 * @emits CCFileCheck#done
 * @emits CCFileCheck#error
 *
 * @param {Array<string>} argv An array representing the CLI arguments that will be parsed by this class.
 * @throws {Error} Thrown if argv is not null, undefined or an Array.
 *
 * @suppress {misplacedTypeAnnotation}
 */
Instantiates a CCFileCheck object.
@classdesc This class parses the passed arguments array and starts processing the configuration files and the
corresponding file checkings whether the specified files are used in any compilation unit.

@constructor



@param {Array} argv An array representing the CLI arguments that will be parsed by this class.
@throws {Error} Thrown if argv is not null, undefined or an Array.


Instantiates a CCFileCheck object . @classdesc This class parses the passed arguments array and starts processing the configuration files and the corresponding file checkings whether the specified files are used in any compilation unit . @constructor @param { Array } argv An array representing the CLI arguments that will be parsed by this class . @throws { Error } Thrown if argv is not null undefined or an Array .
function CCFileCheck (argv) {
    if (!argv) argv = [];
    if (!util.isArray(argv)) throw Error('"argv" must be a string array!');
    events.EventEmitter.call(this);
    this._cli = new CLI(argv);
    var self = this;
    this._cli.on('argsError', function (err) {
        self.emit('argsError', err);
    });
    this._cli.on('help', function (helpInfo) {
        self.emit('help', helpInfo);
    });
    this._cli.on('version', function (versionInfo) {
        self.emit('version', versionInfo);
    });
    this._cli.on('configHelp', function (configHelpInfo) {
        self.emit('configHelp', configHelpInfo);
    });
    this._cli.on('closureHelp', function (closureHelpInfo) {
        self.emit('closureHelp', closureHelpInfo);
    });
    this._cli.on('closureVersion', function (closureVersionInfo) {
        self.emit('closureVersion', closureVersionInfo);
    });
    this._cli.on('compilerPath', function (compilerPath) {
        self.emit('compilerPath', compilerPath);
    });
    this._cli.on('contribPath', function (contribPath) {
        self.emit('contribPath', contribPath);
    });
    this._cli.on('argsParsed', function (args) {
        self.emit('argsParsed', args);
    });
    self.once('argsParsed', function (cliArgs) {
        if (cliArgs.ignoreCheckFs) {
            self.emit('done');
        } else {
            var processConfigsOperation;
            if (cliArgs.configs) {
                processConfigsOperation = self._processConfigs(
                    (cliArgs));
            } else {
                processConfigsOperation = configurationReader.getLocalConfigFiles()
                    .then(function (configFiles) {
                        cliArgs.configs = configFiles;
                        return self._processConfigs(
                            (cliArgs));
                    });
            }
            processConfigsOperation
                .then(function (args) {
                    self.emit('done');
                })
                .catch(function (err) {
                    self.emit('error', err);
                });
        }
    });
}
function CCFileCheck ( argv ) { if ( ! argv ) argv = [ ] ; if ( ! util . isArray ( argv ) ) throw Error ( '"argv" must be a string array!' ) ; events . EventEmitter . call ( this ) ; this . _cli = new CLI ( argv ) ; var self = this ; this . _cli . on ( 'argsError' , function ( err ) { self . emit ( 'argsError' , err ) ; } ) ; this . _cli . on ( 'help' , function ( helpInfo ) { self . emit ( 'help' , helpInfo ) ; } ) ; this . _cli . on ( 'version' , function ( versionInfo ) { self . emit ( 'version' , versionInfo ) ; } ) ; this . _cli . on ( 'configHelp' , function ( configHelpInfo ) { self . emit ( 'configHelp' , configHelpInfo ) ; } ) ; this . _cli . on ( 'closureHelp' , function ( closureHelpInfo ) { self . emit ( 'closureHelp' , closureHelpInfo ) ; } ) ; this . _cli . on ( 'closureVersion' , function ( closureVersionInfo ) { self . emit ( 'closureVersion' , closureVersionInfo ) ; } ) ; this . _cli . on ( 'compilerPath' , function ( compilerPath ) { self . emit ( 'compilerPath' , compilerPath ) ; } ) ; this . _cli . on ( 'contribPath' , function ( contribPath ) { self . emit ( 'contribPath' , contribPath ) ; } ) ; this . _cli . on ( 'argsParsed' , function ( args ) { self . emit ( 'argsParsed' , args ) ; } ) ; self . once ( 'argsParsed' , function ( cliArgs ) { if ( cliArgs . ignoreCheckFs ) { self . emit ( 'done' ) ; } else { var processConfigsOperation ; if ( cliArgs . configs ) { processConfigsOperation = self . _processConfigs ( ( cliArgs ) ) ; } else { processConfigsOperation = configurationReader . getLocalConfigFiles ( ) . then ( function ( configFiles ) { cliArgs . configs = configFiles ; return self . _processConfigs ( ( cliArgs ) ) ; } ) ; } processConfigsOperation . then ( function ( args ) { self . emit ( 'done' ) ; } ) . catch ( function ( err ) { self . emit ( 'error' , err ) ; } ) ; } } ) ; }
Instantiates a CCFileCheck object.
Instantiates a CCFileCheck object .
/**
         * States that the parsing process of the CLI arguments failed.
         *
         * @event CCFileCheck#argsError
         * @param {Error} err The error that occurred during argumentation parsing.
         */ /**
         * States that the option --help or -h was set and that the help message of ccbuild is ready.
         *
         * @event CCFileCheck#help
         * @param {string} helpInfo The help message that can be displayed.
         */ /**
         * States that the option --version or -v was set and that the version information of ccbuild is ready.
         *
         * @event CCFileCheck#version
         * @param {string} versionInfo The requested version information.
         */ /**
         * States that the option --config-help was set and that the help message for configuration files is ready.
         *
         * @event CCFileCheck#configHelp
         * @param {string} configHelpInfo The help message that can be printed.
         */ /**
         * States that the option --closure-help was set and that the help message is ready.
         *
         * @event CCFileCheck#closureHelp
         * @param {string} closureHelpInfo The help message that can be printed.
         */ /**
         * States that the option --closure-version was set and that the version information is ready.
         *
         * @event CCFileCheck#closureVersion
         * @param {string} compilerVersionInfo The requested version information.
         */ /**
         * States that the option --compiler-path was set and that the compiler path information is ready.
         *
         * @event CCFileCheck#compilerPath
         * @param {string} compilerPath The requested compiler path information.
         */ /**
         * States that the option --contrib-path was set and that the contrib path information is ready.
         *
         * @event CCFileCheck#contribPath
         * @param {string} contribPath The requested contrib path information.
         */ /**
         * States that the parsing of CLI arguments was finished was set and that the contrib path information is ready.
         *
         * @event CCFileCheck#argsParsed
         * @param {Object} args The parsed argument object.
         */ /** @type {{stopOnError: boolean}} */ /** @type {{stopOnError: boolean}} */ /**
                     * States that the verification process is finished for all defined files.
                     *
                     * @event CCFileCheck#done
                     */ /**
                     * States that an error occurred during the verification process.
                     *
                     * @event CCFileCheck#error
                     * @param {Error} err The occurred error object.
                     */