Package com.google.gxp.compiler.alerts

Examples of com.google.gxp.compiler.alerts.AlertCounter


        return 1;
      }
      AlertSink alertSink =  new PrintingAlertSink(config.getAlertPolicy(),
                                                   config.isVerboseEnabled(),
                                                   stderr);
      AlertCounter counter = new AlertCounter(alertSink, config.getAlertPolicy());
      new Compiler(config).call(counter);
      return (counter.getErrorCount() > 0) ? 1 : 0;
    } catch (CmdLineException usageError) {
      stderr.append(usageError.getMessage() + "\n");
      return 1;
    } catch (InvalidConfigException invalidConfigException) {
      stderr.append(invalidConfigException.getMessage() + "\n");
View Full Code Here


  }

  public void execute() throws BuildException {
    configure();
    AlertSink alertSink = new LoggingAlertSink(getAlertPolicy(), this);
    AlertCounter counter = new AlertCounter(alertSink, getAlertPolicy());

    try {
      new Compiler(this).call(counter);
    } catch (InvalidConfigException e) {
      throw new BuildException(e);
    }

    if (counter.getErrorCount() > 0) {
      throw new BuildException("Compile failed; see the compiler error output for details.");
    }
  }
View Full Code Here

    SourcePosition outputPosition = new SourcePosition(outputFileRef);
    alertSink.add(new ProgressAlert(outputPosition, "Generating"));
    CodeGenerator codeGenerator =
        codeGeneratorFactory.getCodeGenerator(language, compilationUnit);

    AlertCounter counter = new AlertCounter(alertSink, alertPolicy);

    StringBuilder sb = new StringBuilder();
    try {
      codeGenerator.generateCode(sb, counter);

      if (counter.getErrorCount() == 0) {
        Writer writer = outputFileRef.openWriter(Charsets.US_ASCII);
        try {
          writer.write(sb.toString());
        } finally {
          writer.close();
View Full Code Here

  }

  public void execute() throws BuildException {
    configure();
    AlertSink alertSink = new LoggingAlertSink(getAlertPolicy(), this);
    AlertCounter counter = new AlertCounter(alertSink, getAlertPolicy());

    try {
      log("Compiling "+sourceFiles.size()+" source files to "+outputDir.toFilename());
      new Compiler(this).call(counter);
    } catch (InvalidConfigException e) {
      throw new BuildException(e);
    }

    if (counter.getErrorCount() > 0) {
      throw new BuildException("Compile failed; see the compiler error output for details.");
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.alerts.AlertCounter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.