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

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


          permutationResult.getStatementRanges(), permutationResult.getPermutationId());
      resultsByStrongName.put(result.getStrongName(), result);
      artifacts.add(result);

      // Add any other Permutations
      ArtifactSet otherArtifacts = permutationResult.getArtifacts();
      if (otherArtifacts != null) {
        artifacts.addAll(otherArtifacts);
      }
    }
    return result;
View Full Code Here


  /**
   * 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

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

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

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

          File absPath = new File(options.getWarDir(), module.getName());
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

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

    artifacts = new ArtifactSet(artifacts);

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    for (CompilationResult result : artifacts.find(CompilationResult.class)) {
      PrintWriter pw = new PrintWriter(out);
View Full Code Here

  }

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

    for (StandardCompilationAnalysis soycFiles : artifacts.find(StandardCompilationAnalysis.class)) {
      if (soycFiles.getDepFile() != null) {
        results.add(soycFiles.getDepFile());
      }
      if (soycFiles.getSizeMapsFile() != null) {
        results.add(soycFiles.getSizeMapsFile());
      }
      if (soycFiles.getDetailedStoriesFile() != null) {
        results.add(soycFiles.getDetailedStoriesFile());
      }
      results.add(soycFiles.getSplitPointsFile());
      if (!soycFiles.getReportFiles().isEmpty()) {
        results.addAll(soycFiles.getReportFiles());
        foundReports = true;
      }
    }

    if (foundReports) {
      // run the final step of the dashboard to generate top-level files
      ArtifactsOutputDirectory out = new ArtifactsOutputDirectory();
      try {
        new SoycDashboard(out).generateCrossPermutationFiles(extractPermutationDescriptions(artifacts));
      } catch (IOException e) {
        logger.log(TreeLogger.ERROR,
            "Error while generating a Story of Your Compile", e);
        e.printStackTrace();
      }
      results.addAll(out.getArtifacts());
    }
    return results;
  }
View Full Code Here

      ArtifactSet generatedArtifacts, Permutation[] permutations,
      List<FileBackedObject<PermutationResult>> resultFiles, File outDir,
      JJSOptions precompileOptions) throws UnableToCompleteException {
    StandardLinkerContext linkerContext = new StandardLinkerContext(logger,
        module, precompileOptions);
    ArtifactSet artifacts = doLink(logger, linkerContext, generatedArtifacts,
        permutations, resultFiles);
    doProduceLegacyOutput(logger, artifacts, linkerContext, module, outDir);
  }
View Full Code Here

      List<FileBackedObject<PermutationResult>> resultFiles, File outDir,
      File extrasDir, JJSOptions precompileOptions)
      throws UnableToCompleteException {
    StandardLinkerContext linkerContext = new StandardLinkerContext(logger,
        module, precompileOptions);
    ArtifactSet artifacts = doLink(logger, linkerContext, generatedArtifacts,
        permutations, resultFiles);
    doProduceOutput(logger, artifacts, linkerContext, module, outDir, extrasDir);
  }
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.