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

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


  /**
   * Run the linker stack.
   */
  public ArtifactSet invokeLink(TreeLogger logger)
      throws UnableToCompleteException {
    ArtifactSet workingArtifacts = new ArtifactSet(artifacts);

    for (Linker linker : linkers) {
      TreeLogger linkerLogger = logger.branch(TreeLogger.TRACE,
          "Invoking Linker " + linker.getDescription(), null);
      workingArtifacts.freeze();
      try {
        workingArtifacts = linker.link(linkerLogger, this, workingArtifacts);
      } catch (Throwable e) {
        linkerLogger.log(TreeLogger.ERROR, "Failed to link", e);
        throw new UnableToCompleteException();
View Full Code Here


    return workingArtifacts;
  }

  public ArtifactSet invokeRelink(TreeLogger logger,
      ArtifactSet newlyGeneratedArtifacts) throws UnableToCompleteException {
    ArtifactSet workingArtifacts = new ArtifactSet(newlyGeneratedArtifacts);

    for (Linker linker : linkers) {
      TreeLogger linkerLogger = logger.branch(TreeLogger.TRACE,
          "Invoking relink on Linker " + linker.getDescription(), null);
      workingArtifacts.freeze();
      try {
        workingArtifacts = linker.relink(linkerLogger, this, workingArtifacts);
      } catch (Throwable e) {
        linkerLogger.log(TreeLogger.ERROR, "Failed to relink", e);
        throw new UnableToCompleteException();
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);
    linkerStack.produceOutputDirectory(linkLogger, artifacts, moduleOutDir,
        moduleExtraDir);
  }
View Full Code Here

    // Find the existing linker stack.
    StandardLinkerContext linkerStack = linkerStacks.get(module.getName());
    assert linkerStack != null;

    ArtifactSet artifacts = linkerStack.invokeRelink(linkLogger,
        newlyGeneratedArtifacts);
    linkerStack.produceOutputDirectory(linkLogger, artifacts, moduleOutDir,
        moduleExtraDir);
  }
View Full Code Here

  }

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

    toReturn.add(emitSelectionScript(logger, context, artifacts));

    return toReturn;
  }
View Full Code Here

  }

  @Override
  public ArtifactSet link(TreeLogger logger, LinkerContext context,
      ArtifactSet artifacts) throws UnableToCompleteException {
    ArtifactSet toReturn = super.link(logger, context, artifacts);

    try {
      // Add hosted mode iframe contents
      // TODO move this into own impl package if HostedModeLinker goes away
      URL resource = HostedModeLinker.class.getResource("hosted.html");
      if (resource == null) {
        logger.log(TreeLogger.ERROR,
            "Unable to find support resource 'hosted.html'");
        throw new UnableToCompleteException();
      }

      final URLConnection connection = resource.openConnection();
      // TODO: extract URLArtifact class?
      EmittedArtifact hostedHtml = new EmittedArtifact(IFrameLinker.class,
          "hosted.html") {
        @Override
        public InputStream getContents(TreeLogger logger)
            throws UnableToCompleteException {
          try {
            return connection.getInputStream();
          } catch (IOException e) {
            logger.log(TreeLogger.ERROR, "Unable to copy support resource", e);
            throw new UnableToCompleteException();
          }
        }

        @Override
        public long getLastModified() {
          return connection.getLastModified();
        }
      };
      toReturn.add(hostedHtml);
    } catch (IOException e) {
      logger.log(TreeLogger.ERROR, "Unable to copy support resource", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

  private final Map<CompilationResult, String> compilationPartialPaths = new IdentityHashMap<CompilationResult, String>();

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

    for (CompilationResult compilation : toReturn.find(CompilationResult.class)) {
      toReturn.add(doEmitCompilation(logger, context, compilation));
    }

    toReturn.add(emitSelectionScript(logger, context, artifacts));
    return toReturn;
  }
View Full Code Here

    // Set up the rebind oracle for the module.
    // It has to wait until now because we need to inject javascript.
    //
    Rules rules = module.getRules();
    rebindOracle = new StandardRebindOracle(module.getCompilationState(logger),
        propOracle, module, rules, genDir, shellDir, new ArtifactSet());

    // 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
    // though they are running separately. This allows the shell to run
View Full Code Here

    public String rebind(TreeLogger logger, String typeName,
        ArtifactAcceptor artifactAcceptor) throws UnableToCompleteException {

      String result = tryRebind(logger, typeName);
      ArtifactSet newlyGeneratedArtifacts = genCtx.finish(logger);
      if (!newlyGeneratedArtifacts.isEmpty() && artifactAcceptor != null) {
        artifactAcceptor.accept(logger, newlyGeneratedArtifacts);
      }
      if (result == null) {
        result = typeName;
      }
View Full Code Here

   * the module's timestamp. For Production Mode, it should be current.
   */
  public void testTimestampOnSelectionScript() throws UnableToCompleteException {
    // Development Mode
    {
      ArtifactSet artifacts = new ArtifactSet();
      ArtifactSet updated = new ShardableSelectionScriptLinker().link(
          TreeLogger.NULL, new MockLinkerContext(), artifacts, false);
      EmittedArtifact selectionScript = findSelectionScript(updated);
      assertEquals(MOCK_MODULE_LAST_MODIFIED, selectionScript.getLastModified());
    }

    // Production Mode
    {
      ArtifactSet artifacts = new ArtifactSet();
      artifacts.add(createCompilationResult());
      ArtifactSet updated = new ShardableSelectionScriptLinker().link(
          TreeLogger.NULL, new MockLinkerContext(), artifacts, true);
      updated = transferThinning(updated);
      updated = new ShardableSelectionScriptLinker().link(TreeLogger.NULL,
          new MockLinkerContext(), updated, false);
      EmittedArtifact selectionScript = findSelectionScript(updated);
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.