Examples of EmittedArtifact


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

   * Override to change the manner in which the symbol map is emitted.
   */
  protected void doEmitSymbolMap(TreeLogger logger, ArtifactSet artifacts,
      CompilationResult result, ByteArrayOutputStream out)
      throws UnableToCompleteException {
    EmittedArtifact symbolMapArtifact = emitBytes(logger, out.toByteArray(),
        result.getStrongName() + STRONG_NAME_SUFFIX);
    symbolMapArtifact.setPrivate(true);
    artifacts.add(symbolMapArtifact);
  }
View Full Code Here

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

             * If the artifact has no strong name of its own, use the
             * compilation strong name.
             */
            policyStrongName = result.getStrongName();
          }
          EmittedArtifact art = emitBytes(logger, logArt.getContents(),
              logArt.getQualifiedSourceName() + "-" + policyStrongName
                  + ".rpc.log");
          art.setVisibility(Visibility.Private);
          toReturn.add(art);
        }
      }

      return toReturn;
View Full Code Here

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

      }
      return toReturn;
    } else {
      permutationsUtil.setupPermutationsMap(artifacts);
      ArtifactSet toReturn = new ArtifactSet(artifacts);
      EmittedArtifact art = emitSelectionScript(logger, context, artifacts);
      if (art != null) {
        toReturn.add(art);
      }
      maybeOutputPropertyMap(logger, context, toReturn);
      maybeAddHostedModeFile(logger, context, toReturn, null);
View Full Code Here

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

        throw new UnableToCompleteException();
      }

      final URLConnection connection = resource.openConnection();
      // TODO: extract URLArtifact class?
      EmittedArtifact hostedFile = new EmittedArtifact(
          SelectionScriptLinker.class, hostedFilename) {
        @Override
        public InputStream getContents(TreeLogger logger)
            throws UnableToCompleteException {
          try {
View Full Code Here

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

  /**
   * Create a mock emitted artifact with the given path.
   */
  private static EmittedArtifact emitted(String path) {
    return new EmittedArtifact(SoycReportLinker.class, path) {
      @Override
      public InputStream getContents(TreeLogger logger) {
        return new NullInputStream();
      }
    };
View Full Code Here

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

        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 {
View Full Code Here

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

      throws UnableToCompleteException {
    StringBuffer b = new StringBuffer();
    b.append(getModulePrefix(logger, context));
    b.append(result.getJavaScript());
    b.append(getModuleSuffix(logger, context));
    EmittedArtifact toReturn = emitWithStrongName(logger,
        Util.getBytes(b.toString()), "", getCompilationExtension(logger,
            context));
    compilationPartialPaths.put(result, toReturn.getPartialPath());
    return toReturn;
  }
View Full Code Here

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

    // 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);
      assertTrue(MOCK_MODULE_LAST_MODIFIED != selectionScript.getLastModified());
    }
  }
View Full Code Here

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

   * 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");
    assertNotNull(fooGz);
    assertEqualBytes(contents(foo), decompress(contents(fooGz)));

    EmittedArtifact barGz = findArtifact(updated, "bar.js.gz");
    assertNull("bar.js is private and should not have been compressed", barGz);

    EmittedArtifact uncompressibleGz = findArtifact(updated,
        "uncompressible.js.gz");
    assertNull(
        "uncompressible.js is not compressible and should have been left alone",
        uncompressibleGz);
  }
View Full Code Here

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

  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);

    // foo.js matches two regexes; the last should win
    EmittedArtifact fooGz = findArtifact(updated, "foo.js.gz");
    assertNull("foo.js should not have been compressed", fooGz);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.