Package com.google.gwt.dev.cfg

Examples of com.google.gwt.dev.cfg.Compilation


      // We still need to verify that the source for generated types hasn't
      // changed.
      //
      TreeLogger branch = logger.branch(TreeLogger.DEBUG,
          "Loading cached compilation: " + cacheXml, null);
      Compilation c = new Compilation();
      c.setStrongName(strongName);
      CompilationSchema schema = new CompilationSchema(c);
      FileReader r = null;
      Throwable caught = null;
      try {
        r = new FileReader(cacheXml);
        ReflectiveParser.parse(logger, schema, r);
      } catch (FileNotFoundException e) {
        caught = e;
      } catch (UnableToCompleteException e) {
        caught = e;
      } finally {
        Utility.close(r);
      }

      if (caught != null) {
        String msg = "Unable to load the cached file";
        branch.log(TreeLogger.WARN, msg, caught);
        continue;
      }

      // Check that the hash code of the generated sources for this compilation
      // matches the current generated source for the same type.
      //
      boolean isBadCompilation = false;
      String[] genTypes = c.getGeneratedTypeNames();
      for (int j = 0; j < genTypes.length; j++) {
        String genTypeName = genTypes[j];
        String cachedHash = c.getTypeHash(genTypeName);
        JClassType genType = typeOracle.findType(genTypeName);
        if (genType == null) {
          // This cache entry refers to a type that no longer seems to exist.
          // Remove it.
          //
View Full Code Here


    // Check to see if we already have this compilation.
    // This will have the effect of filling the rebind oracle's cache.
    //
    String[] entryPts = module.getEntryPointTypeNames();
    Compilation cached = compilations.find(logger, rebindOracle, entryPts);
    if (cached != null) {
      msg = "Matches existing compilation " + cached.getStrongName();
      logger.log(TreeLogger.TRACE, msg, null);
      return cached.getStrongName();
    }

    // Now attach a compilation into which we can record the particular inputs
    // and outputs used by this compile process.
    //
    Compilation compilation = new Compilation();
    rebindOracle.recordInto(compilation);

    // Create JavaScript.
    //
    String js = jjs.compile(logger, rebindOracle);

    // Create a wrapper and an unambiguous name for the file.
    //
    String strongName = writeHtmlAndJsWithStrongName(logger, js);

    // Write out a cache control file that correlates to this script.
    //
    compilation.setStrongName(strongName);
    writeCacheFile(logger, compilation);

    // Add this compilation to the list of known compilations.
    //
    compilations.add(compilation);
    return compilation.getStrongName();
  }
View Full Code Here

      // We still need to verify that the source for generated types hasn't
      // changed.
      //
      TreeLogger branch = logger.branch(TreeLogger.DEBUG,
          "Loading cached compilation: " + cacheXml, null);
      Compilation c = new Compilation();
      c.setStrongName(strongName);
      CompilationSchema schema = new CompilationSchema(c);
      FileReader r = null;
      Throwable caught = null;
      try {
        r = new FileReader(cacheXml);
        ReflectiveParser.parse(logger, schema, r);
      } catch (FileNotFoundException e) {
        caught = e;
      } catch (UnableToCompleteException e) {
        caught = e;
      } finally {
        Utility.close(r);
      }

      if (caught != null) {
        String msg = "Unable to load the cached file";
        branch.log(TreeLogger.WARN, msg, caught);
        continue;
      }

      // Check that the hash code of the generated sources for this compilation
      // matches the current generated source for the same type.
      //
      boolean isBadCompilation = false;
      String[] genTypes = c.getGeneratedTypeNames();
      for (int j = 0; j < genTypes.length; j++) {
        String genTypeName = genTypes[j];
        String cachedHash = c.getTypeHash(genTypeName);
        JClassType genType = typeOracle.findType(genTypeName);
        if (genType == null) {
          // This cache entry refers to a type that no longer seems to exist.
          // Remove it.
          //
View Full Code Here

    // Check to see if we already have this compilation.
    // This will have the effect of filling the rebind oracle's cache.
    //
    String[] entryPts = module.getEntryPointTypeNames();
    Compilation cached = compilations.find(logger, rebindOracle, entryPts);
    if (cached != null) {
      msg = "Matches existing compilation " + cached.getStrongName();
      logger.log(TreeLogger.TRACE, msg, null);
      return cached.getStrongName();
    }

    // Now attach a compilation into which we can record the particular inputs
    // and outputs used by this compile process.
    //
    Compilation compilation = new Compilation();
    rebindOracle.recordInto(compilation);

    // Create JavaScript.
    //
    String js = jjs.compile(logger, rebindOracle);

    // Create a wrapper and an unambiguous name for the file.
    //
    String strongName = writeHtmlAndJsWithStrongName(logger, js);

    // Write out a cache control file that correlates to this script.
    //
    compilation.setStrongName(strongName);
    writeCacheFile(logger, compilation);

    // Add this compilation to the list of known compilations.
    //
    compilations.add(compilation);
    return compilation.getStrongName();
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.cfg.Compilation

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.