Package com.google.gwt.core.ext.linker

Examples of com.google.gwt.core.ext.linker.ArtifactSet


            + "'; please run Precompile first");
        return false;
      }

      List<Permutation> permsList = new ArrayList<Permutation>();
      ArtifactSet generatedArtifacts = new ArtifactSet();
      JJSOptions precompileOptions = null;

      for (PrecompilationFile precompilationFile : precomps) {
        Precompilation precompilation;
        try {
          precompilation = precompilationFile.newInstance(logger);
        } catch (UnableToCompleteException e) {
          return false;
        }
        permsList.addAll(Arrays.asList(precompilation.getPermutations()));
        generatedArtifacts.addAll(precompilation.getGeneratedArtifacts());
        precompileOptions = precompilation.getUnifiedAst().getOptions();
      }

      Permutation[] perms = permsList.toArray(new Permutation[permsList.size()]);

      List<FileBackedObject<PermutationResult>> resultFiles = new ArrayList<FileBackedObject<PermutationResult>>(
          perms.length);
      for (int i = 0; i < perms.length; ++i) {
        File f = CompilePerms.makePermFilename(compilerWorkDir,
            perms[i].getId());
        if (!f.exists()) {
          logger.log(TreeLogger.ERROR, "File not found '" + f.getAbsolutePath()
              + "'; please compile all permutations");
          return false;
        }
        resultFiles.add(new FileBackedObject<PermutationResult>(
            PermutationResult.class, f));
      }

      TreeLogger branch = logger.branch(TreeLogger.INFO, "Linking module "
          + module.getName());
      StandardLinkerContext linkerContext = new StandardLinkerContext(branch,
          module, precompileOptions);

      ArtifactSet artifacts = doLink(branch, linkerContext, generatedArtifacts,
          perms, resultFiles);

      if (options.getOutDir() == null) {
        doProduceOutput(branch, artifacts, linkerContext, module,
            options.getWarDir(), options.getExtraDir());
View Full Code Here


      }

      uncommittedGeneratedCupsByPrintWriter.clear();
      committedGeneratedCups.clear();
      newlyGeneratedTypeNames.clear();
      newlyGeneratedArtifacts = new ArtifactSet();
    }
  }
View Full Code Here

    public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts,boolean onePurmutation)
        throws UnableToCompleteException {
    if(onePurmutation)
      return artifacts;
     
    ArtifactSet toReturn = new ArtifactSet(artifacts);
      StringBuilder sb=new StringBuilder("CACHE MANIFEST\n");
     
      logger.log(Type.INFO, "Start linking appcache manifest...");
      sb.append("# Unique id #" + (new Date()).getTime() +"."+ Math.random() + "\n");
      sb.append("CACHE:\n");
      sb.append("# Note: must change this every time for cache to invalidate\n");
      sb.append("\n");
      sb.append("#Generated app files\n");
      sb.append(getPublicSourceFiles(logger, context, toReturn));
      sb.append("# Static app files\n");
      sb.append(getPropertiesExtraFiles(logger, context));
      sb.append("\n\n");
      sb.append("#All other resources require the user to be online.\n");
      sb.append("NETWORK:\n");
      sb.append("*\n");
     
      logger.log(TreeLogger.DEBUG, "Make sure you have the following"
              + " attribute added to your landing page's <html> tag: <html manifest=\""
              + context.getModuleFunctionName() + "/" + MANIFEST + "\">");
      // Create the general cache-manifest resource artifact
      toReturn.add(this.emitString(logger, sb.toString(), MANIFEST));
     
      return toReturn;
    }
View Full Code Here

  @Override
  public ArtifactSet link(TreeLogger logger, LinkerContext context,
      ArtifactSet artifacts, boolean onePermutation)
      throws UnableToCompleteException {
    if (onePermutation) {
      artifacts = new ArtifactSet(artifacts);

      Map<String, List<String>> allSerializableFields = new HashMap<String, List<String>>();

      for (RpcDataArtifact data : artifacts.find(RpcDataArtifact.class)) {
        allSerializableFields.putAll(data.getOperableFields());
View Full Code Here

  }

  @Override
  public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation) throws UnableToCompleteException
  {
    ArtifactSet artifactset = new ArtifactSet(artifacts);

    if (onePermutation)
    {
      analyzePermutationArtifacts(artifactset);
      analyzed.set(true);
View Full Code Here

      genCtx.setPropertyOracle(propOracle);
      String result = tryRebind(logger, typeName);
      if (artifactAcceptor != null) {
        // Go ahead and call finish() to accept new artifacts.
        ArtifactSet newlyGeneratedArtifacts = genCtx.finish(logger);
        if (!newlyGeneratedArtifacts.isEmpty()) {
          artifactAcceptor.accept(logger, newlyGeneratedArtifacts);
        }
      }
      if (result == null) {
        result = typeName;
View Full Code Here

      }

      uncommittedGeneratedCupsByPrintWriter.clear();
      committedGeneratedCups.clear();
      newlyGeneratedTypeNames.clear();
      newlyGeneratedArtifacts = new ArtifactSet();
    }
  }
View Full Code Here

    // It has to wait until now because we need to inject javascript.
    //
    Rules rules = module.getRules();
    StandardGeneratorContext genCtx = new StandardGeneratorContext(
        module.getCompilationState(logger), module, genDir, shellDir,
        new ArtifactSet());
    rebindOracle = new StandardRebindOracle(propOracle, rules, genCtx);

    // Create a completely isolated class loader which owns all classes
    // associated with a particular module. This effectively builds a
    // separate 'domain' for each running module, so that they all behave as
View Full Code Here

          List<FileBackedObject<PermutationResult>> resultFiles = CompilePerms.makeResultFiles(
              options.getCompilerWorkDir(moduleName), allPerms);
          CompilePerms.compile(logger, precompilation, allPerms,
              options.getLocalWorkers(), resultFiles);

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

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

          Link.legacyLink(logger.branch(TreeLogger.TRACE, "Linking into "
View Full Code Here

    // Create a new active linker stack for the fresh link.
    StandardLinkerContext linkerStack = new StandardLinkerContext(linkLogger,
        module, options);
    linkerStacks.put(module.getName(), linkerStack);

    ArtifactSet artifacts = linkerStack.invokeLink(linkLogger);
    produceOutput(linkLogger, linkerStack, artifacts, module);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.linker.ArtifactSet

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.