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

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


   * in Link cannot be used because it wants a StandardLinkerContext, not an
   * arbitrary LinkerContext.
   */
  @SuppressWarnings("unchecked")
  private ArtifactSet transferThinning(ArtifactSet artifacts) {
    ArtifactSet updated = new ArtifactSet();
    // The raw type Artifact is to work around a Java compiler bug:
    // http://bugs.sun.com/view_bug.do?bug_id=6548436
    for (Artifact art : artifacts) {
      if (art.isTransferableFromShards() || (art instanceof EmittedArtifact)) {
        updated.add(art);
      }
    }
    return updated;
  }
View Full Code Here


   * Test that running a non-shardable linker in simulated sharding mode does
   * not lose the permutations.
   */
  public void testNonShardableHasPermutations()
      throws UnableToCompleteException {
    ArtifactSet artifacts = new ArtifactSet();

    StandardCompilationResult result = createCompilationResult();
    artifacts.add(result);

    ArtifactSet updated = new NonShardableSelectionScriptLinker().link(
        TreeLogger.NULL, new MockLinkerContext(), artifacts);

    SortedSet<SelectionInformation> selectionInfos = updated.find(SelectionInformation.class);
    assertEquals(1, selectionInfos.size());
  }
View Full Code Here

  /**
   * Test that foo.js gets compressed to foo.js.gz, and bar.js is left alone.
   */
  public void testBasics() throws UnableToCompleteException, IOException {
    ArtifactSet updated = linkArtifacts();

    EmittedArtifact foo = findArtifact(updated, "foo.js");
    assertNotNull(foo);

    EmittedArtifact fooGz = findArtifact(updated, "foo.js.gz");
View Full Code Here

  /**
   * Test that the blacklist takes effect.
   */
  public void testBlackList() throws UnableToCompleteException {
    propPathRegexes.values.add("-foo\\.js");
    ArtifactSet updated = linkArtifacts();

    // foo.txt is not in the list of patterns, so don't compress
    EmittedArtifact stuffGz = findArtifact(updated, "stuff.txt.gz");
    assertNull("stuff.txt should not have been compressed", stuffGz);

View Full Code Here

   * Tests that if precompress.leave.original if false, the originals are
   * removed.
   */
  public void testRemovingOriginals() throws UnableToCompleteException {
    propLeaveOriginals.setValue("false");
    ArtifactSet updated = linkArtifacts();
    EmittedArtifact foo = findArtifact(updated, "foo.js");
    assertNull("foo.js should have been removed", foo);
  }
View Full Code Here

  }

  @Override
  protected void setUp() {
    // add some artifacts to test with
    artifacts = new ArtifactSet();
    artifacts.add(emit("foo.js", fooFileContents()));
    artifacts.add(emitPrivate("bar.js", fooFileContents()));
    artifacts.add(emit("uncompressible.js", uncompressibleContent()));
    artifacts.add(emit("stuff.txt", fooFileContents()));
    artifacts.add(emit("data.xml", fooFileContents()));
View Full Code Here

  public CachedGeneratorResultImpl(String resultTypeName, ArtifactSet artifacts,
      Map<String, GeneratedUnit> generatedUnitMap, long timeGenerated,
      Map<String, Serializable> clientDataMap) {
    this.resultTypeName = resultTypeName;
    this.artifacts = new ArtifactSet(artifacts);
    this.generatedUnitMap = new HashMap<String, GeneratedUnit>(generatedUnitMap);
    this.timeGenerated = timeGenerated;
    assert clientDataMap instanceof Serializable;
    this.clientDataMap = clientDataMap;
  }
View Full Code Here

        logger.branch(TreeLogger.DEBUG, "Linking module '" + module.getName() + "'");

    // Create a new active linker stack for the fresh link.
    StandardLinkerContext linkerStack = new StandardLinkerContext(
        linkLogger, module, compilerContext.getPublicResourceOracle(), options.getOutput());
    ArtifactSet artifacts = linkerStack.getArtifactsForPublicResources(logger, module);
    artifacts = linkerStack.invokeLegacyLinkers(linkLogger, artifacts);
    artifacts = linkerStack.invokeFinalLink(linkLogger, artifacts);
    produceOutput(linkLogger, linkerStack, artifacts, module, false);
    return linkerStack;
  }
View Full Code Here

  private void relink(TreeLogger logger, StandardLinkerContext linkerContext, ModuleDef module,
      ArtifactSet newlyGeneratedArtifacts) throws UnableToCompleteException {
    TreeLogger linkLogger =
        logger.branch(TreeLogger.DEBUG, "Relinking module '" + module.getName() + "'");

    ArtifactSet artifacts = linkerContext.invokeRelink(linkLogger, newlyGeneratedArtifacts);
    produceOutput(linkLogger, linkerContext, artifacts, module, true);
  }
View Full Code Here

   */
  public void reset() {
    uncommittedGeneratedCupsByPrintWriter.clear();
    committedGeneratedCups.clear();
    newlyGeneratedTypeNames.clear();
    newlyGeneratedArtifacts = new ArtifactSet();
    cachedTypeNamesToReuse = null;
  }
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.