Package com.google.gwt.core.ext

Examples of com.google.gwt.core.ext.TreeLogger


  @Override
  protected int doStartUpServer() {
    try {
      ui.setCallback(RestartServerEvent.getType(), this);
      // TODO(jat): find a safe way to get an icon for the servlet container
      TreeLogger serverLogger = ui.getWebServerLogger(getWebServerName(), null);
      serverLogger.log(TreeLogger.TRACE, "Starting HTTP on port " + getPort(),
          null);

      ServletContainerLauncher scl = options.getServletContainerLauncher();
      /*
       * TODO: This is a hack to pass the base log level to the SCL. We'll have
View Full Code Here


    }
  }

  private void validateServletTags(TreeLogger logger,
      ServletValidator servletValidator, ModuleDef module, File webXml) {
    TreeLogger servletLogger = logger.branch(TreeLogger.DEBUG,
        "Validating <servlet> tags for module '" + module.getName() + "'",
        null, new InstalledHelpInfo("servletMappings.html"));
    String[] servletPaths = module.getServletPaths();
    if (servletValidator == null && servletPaths.length > 0) {
      servletLogger.log(
          TreeLogger.WARN,
          "Module declares "
              + servletPaths.length
              + " <servlet> declaration(s), but a valid 'web.xml' was not found at '"
              + webXml.getAbsolutePath() + "'");
View Full Code Here

        }
      }
    }

    // Create the public path.
    TreeLogger branch = Messages.PUBLIC_PATH_LOCATIONS.branch(logger, null);
    // lazyPublicOracle = publicPathEntries.create(branch);
    if (lazyPublicOracle == null) {
      lazyPublicOracle = new ResourceOracleImpl(branch);
      lazyPublicOracle.setPathPrefixes(publicPrefixSet);
    }
    lazyPublicOracle.refresh(branch);

    // Create the source path.
    branch = Messages.SOURCE_PATH_LOCATIONS.branch(logger, null);
    lazySourceOracle = new ResourceOracleImpl(branch);
    lazySourceOracle.setPathPrefixes(sourcePrefixSet);
    lazySourceOracle.refresh(branch);
    if (lazySourceOracle.getResources().isEmpty()) {
      branch.log(TreeLogger.WARN,
          "No source path entries; expect subsequent failures", null);
    }

    PerfLogger.end();
  }
View Full Code Here

    TypeOracle typeOracle = compilationState.getTypeOracle();
    if (typeOracle.findType("java.lang.Object") == null) {
      Util.logMissingTypeErrorWithHints(logger, "java.lang.Object");
      seedTypesMissing = true;
    } else {
      TreeLogger branch = logger.branch(TreeLogger.TRACE,
          "Finding entry point classes", null);
      String[] typeNames = getEntryPointTypeNames();
      for (int i = 0; i < typeNames.length; i++) {
        String typeName = typeNames[i];
        if (typeOracle.findType(typeName) == null) {
View Full Code Here

          this.lookupEnvironment.unitBeingCompleted = null;
        }

        ICompilationUnit cu = unit.compilationResult.compilationUnit;
        String loc = String.valueOf(cu.getFileName());
        TreeLogger branch = logger.branch(TreeLogger.SPAM,
            "Scanning for additional dependencies: " + loc, null);

        // Examine the cud for magic types.
        //
        String[] typeNames = outer.doFindAdditionalTypesUsingJsni(branch, unit);
View Full Code Here

        if (errors != null && errors.length > 0) {
          // Dump it to disk.
          //
          String fn = String.valueOf(result.compilationUnit.getFileName());
          String msg = "Errors in '" + fn + "'";
          TreeLogger branch = logger.branch(TreeLogger.ERROR, msg, null);

          for (int i = 0; i < errors.length; i++) {
            IProblem error = errors[i];

            // Strip the initial code from each error.
            //
            msg = error.toString();
            msg = msg.substring(msg.indexOf(' '));

            // Append 'Line #: msg' to the error message.
            //
            StringBuffer msgBuf = new StringBuffer();
            int line = error.getSourceLineNumber();
            if (line > 0) {
              msgBuf.append("Line ");
              msgBuf.append(line);
              msgBuf.append(": ");
            }
            msgBuf.append(msg);

            HelpInfo helpInfo = null;
            if (error instanceof GWTProblem) {
              GWTProblem gwtProblem = (GWTProblem) error;
              helpInfo = gwtProblem.getHelpInfo();
            }
            branch.log(TreeLogger.ERROR, msgBuf.toString(), null, helpInfo);
          }
        }
      }
View Full Code Here

        return findType(CharOperation.arrayConcat(pkg, type));
      }

      public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
        String qname = CharOperation.toString(compoundTypeName);
        TreeLogger branch = logger.branch(TreeLogger.SPAM,
            "Compiler is asking about '" + qname + "'", null);

        if (isPackage(qname)) {
          branch.log(TreeLogger.SPAM, "Found to be a package", null);
          return null;
        }

        // Didn't find it in the cache, so let's compile from source.
        // Strip off the inner types, if any
        //
        String className = qname;
        int pos = qname.indexOf('$');
        if (pos >= 0) {
          qname = qname.substring(0, pos);
        }
        CompilationUnit unit = findCompilationUnit(qname);
        if (unit != null) {
          branch.log(TreeLogger.SPAM, "Found type in compilation unit: "
              + unit.getDisplayLocation());
          ICompilationUnit icu = new CompilationUnitAdapter(unit);
          return new NameEnvironmentAnswer(icu, null);
        } else {
          ClassLoader classLoader = getClassLoader();
          URL resourceURL = classLoader.getResource(className.replace('.', '/')
              + ".class");
          if (resourceURL != null) {
            /*
             * We know that there is a .class file that matches the name that we
             * are looking for. However, at least on OSX, this lookup is case
             * insensitive so we need to use Class.forName to effectively verify
             * the case.
             */
            if (isBinaryType(classLoader, className)) {
              byte[] classBytes = Util.readURLAsBytes(resourceURL);
              ClassFileReader cfr;
              try {
                cfr = new ClassFileReader(classBytes, null);
                return new NameEnvironmentAnswer(cfr, null);
              } catch (ClassFormatException e) {
                // Ignored.
              }
            }
          }

          branch.log(TreeLogger.SPAM, "Not a known type", null);
          return null;
        }
      }
View Full Code Here

  }

  @Override
  protected int doStartUpServer() {
    // TODO(jat): find a safe way to get an icon for Tomcat
    TreeLogger logger = ui.getWebServerLogger("Tomcat", null);
    // TODO(bruce): make tomcat work in terms of the modular launcher
    String whyFailed = EmbeddedTomcatServer.start(isHeadless() ? getTopLogger()
        : logger, getPort(), options, shouldAutoGenerateResources());

    if (whyFailed != null) {
View Full Code Here

              options.getDumpSignatureFile())) {
            return false;
          }
        } else {
          long compileStart = System.currentTimeMillis();
          TreeLogger branch = logger.branch(TreeLogger.INFO,
              "Compiling module " + moduleName);

          // Optimize early since permutation compiles will run in process.
          options.setOptimizePrecompile(true);
          Precompilation precompilation = Precompile.precompile(branch,
              options, module, options.getGenDir(), compilerWorkDir,
              options.getDumpSignatureFile());

          if (precompilation == null) {
            return false;
          }

          Permutation[] allPerms = precompilation.getPermutations();
          List<FileBackedObject<PermutationResult>> resultFiles = CompilePerms.makeResultFiles(
              options.getCompilerWorkDir(moduleName), allPerms);
          CompilePerms.compile(branch, precompilation, allPerms,
              options.getLocalWorkers(), resultFiles);

          ArtifactSet generatedArtifacts = precompilation.getGeneratedArtifacts();
          JJSOptions precompileOptions = precompilation.getUnifiedAst().getOptions();

          precompilation = null; // No longer needed, so save the memory

          File absPath = new File(options.getWarDir(), module.getName());
          absPath = absPath.getAbsoluteFile();
          String logMessage = "Linking into " + absPath + ".";
          if (options.getExtraDir() != null) {
              File absExtrasPath = new File(options.getExtraDir(), module.getName());
              absExtrasPath = absExtrasPath.getAbsoluteFile();
              logMessage += " Writing extras to " + absExtrasPath;
          }
          Link.link(logger.branch(TreeLogger.TRACE, logMessage),
              module, generatedArtifacts, allPerms, resultFiles,
              options.getWarDir(), options.getExtraDir(), precompileOptions);

          long compileDone = System.currentTimeMillis();
          long delta = compileDone - compileStart;
          branch.log(TreeLogger.INFO, "Compilation succeeded -- "
              + String.format("%.3f", delta / 1000d) + "s");
        }
      }

    } catch (IOException e) {
View Full Code Here

    // Set done callback
    ui.setCallback(DoneEvent.getType(), this);

    // Check for updates
    final TreeLogger logger = getTopLogger();
    final CheckForUpdates updateChecker = CheckForUpdates.createUpdateChecker(logger);
    if (updateChecker != null) {
      Thread checkerThread = new Thread("GWT Update Checker") {
        @Override
        public void run() {
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.TreeLogger

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.