Package com.google.gwt.dev.cfg

Examples of com.google.gwt.dev.cfg.LibraryWriter


    this.resourceLoader = resourceLoader;
  }

  private void compileModule(TreeLogger logger) throws UnableToCompleteException {
    long beforeCompileMs = System.currentTimeMillis();
    LibraryWriter libraryWriter = compilerContext.getLibraryWriter();

    try {
      if (compilerOptions.isValidateOnly()) {
        boolean valid = Precompile.validate(logger, compilerContext);
        if (!valid) {
          // The real cause has been logged.
          throw new UnableToCompleteException();
        }
      }

      Precompilation precompilation = Precompile.precompile(logger, compilerContext);
      if (precompilation == null) {
        // The real cause has been logged.
        throw new UnableToCompleteException();
      }
      // TODO(stalcup): move to precompile() after params are refactored
      if (!compilerOptions.shouldSaveSource()) {
        precompilation.removeSourceArtifacts(logger);
      }

      Event compilePermutationsEvent =
          SpeedTracerLogger.start(CompilerEventType.COMPILE_PERMUTATIONS);
      permutations = new Permutation[] {precompilation.getPermutations()[0]};
      List<PersistenceBackedObject<PermutationResult>> permutationResultFiles =
          new ArrayList<PersistenceBackedObject<PermutationResult>>();
      permutationResultFiles.add(libraryWriter.getPermutationResultHandle());
      CompilePerms.compile(logger, compilerContext, precompilation, permutations,
          compilerOptions.getLocalWorkers(), permutationResultFiles);
      compilePermutationsEvent.end();

      generatedArtifacts = precompilation.getGeneratedArtifacts();
      libraryWriter.addGeneratedArtifacts(generatedArtifacts);
      libraryWriter.setCompilationErrorsIndex(compilerContext.getLocalCompilationErrorsIndex());
    } finally {
      // Even if a compile problem occurs, close the library cleanly so that it can be examined.
      libraryWriter.write();
    }

    long durationMs = System.currentTimeMillis() - beforeCompileMs;
    TreeLogger detailBranch = logger.branch(TreeLogger.INFO,
        String.format("%.3fs -- Translating Java to Javascript", durationMs / 1000d));
View Full Code Here


    this.resourceLoader = resourceLoader;
  }

  private void compileModule(TreeLogger logger) throws UnableToCompleteException {
    long beforeCompileMs = System.currentTimeMillis();
    LibraryWriter libraryWriter = compilerContext.getLibraryWriter();

    try {
      if (compilerOptions.isValidateOnly()) {
        boolean valid = Precompile.validate(logger, compilerContext);
        if (!valid) {
          // The real cause has been logged.
          throw new UnableToCompleteException();
        }
      }

      Precompilation precompilation = Precompile.precompile(logger, compilerContext);
      if (precompilation == null) {
        // The real cause has been logged.
        throw new UnableToCompleteException();
      }
      // TODO(stalcup): move to precompile() after params are refactored
      if (!compilerOptions.shouldSaveSource()) {
        precompilation.removeSourceArtifacts(logger);
      }

      Event compilePermutationsEvent =
          SpeedTracerLogger.start(CompilerEventType.COMPILE_PERMUTATIONS);
      permutations = new Permutation[] {precompilation.getPermutations()[0]};
      List<PersistenceBackedObject<PermutationResult>> permutationResultFiles =
          new ArrayList<PersistenceBackedObject<PermutationResult>>();
      permutationResultFiles.add(libraryWriter.getPermutationResultHandle());
      CompilePerms.compile(logger, compilerContext, precompilation, permutations,
          compilerOptions.getLocalWorkers(), permutationResultFiles);
      compilePermutationsEvent.end();

      generatedArtifacts = precompilation.getGeneratedArtifacts();
      libraryWriter.addGeneratedArtifacts(generatedArtifacts);
    } finally {
      // Even if a compile problem occurs, close the library cleanly so that it can be examined.
      libraryWriter.write();
    }

    long durationMs = System.currentTimeMillis() - beforeCompileMs;
    TreeLogger detailBranch = logger.branch(TreeLogger.INFO,
        String.format("%.3fs -- Translating Java to Javascript", durationMs / 1000d));
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.cfg.LibraryWriter

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.