Package com.google.gwt.dev.cfg

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


      prop.addCollapsedValues("true", "false");
    }

    // Permutations and their values are in stable alphabetical order.
    //
    PropertyPermutations perms = new PropertyPermutations(md.getProperties(),
        md.getActiveLinkerNames());

    List<PropertyPermutations> collapsed = perms.collapseProperties();
    assertEquals("size", 1, collapsed.size());
    perms = collapsed.get(0);

    String[] perm;
    Iterator<String[]> iter = perms.iterator();

    assertTrue(iter.hasNext());
    perm = iter.next();
    assertEquals("false", perm[0]);
View Full Code Here


      prop.addDefinedValue(prop.getRootCondition(), "true");
    }

    // String[]s and their values are in stable alphabetical order.
    //
    PropertyPermutations perms = new PropertyPermutations(md.getProperties(),
        md.getActiveLinkerNames());
    String[] perm;
    Iterator<String[]> iter = perms.iterator();

    assertTrue(iter.hasNext());
    perm = iter.next();
    assertEquals("false", perm[0]);
    assertEquals("ie6", perm[1]);
View Full Code Here

      prop.addDefinedValue(prop.getRootCondition(), "true");
    }

    // String[]s and their values are in stable alphabetical order.
    //
    PropertyPermutations perms = new PropertyPermutations(md.getProperties(),
        md.getActiveLinkerNames());

    List<PropertyPermutations> collapsed = perms.collapseProperties();
    assertEquals("size", 2, collapsed.size());

    Iterator<String[]> it = collapsed.get(0).iterator();
    assertEquals(Arrays.asList("false", "ie6"), Arrays.asList(it.next()));
    assertEquals(Arrays.asList("false", "moz"), Arrays.asList(it.next()));
View Full Code Here

    validateTwoDimensionPerm(props, md.getActiveLinkerNames());
  }

  private void validateTwoDimensionPerm(Properties props, Set<String> activeLinkerNames) {
    PropertyPermutations perms = new PropertyPermutations(props, activeLinkerNames);

    // Order is alphabetical in dependency order
    Iterator<String[]> iter = perms.iterator();
    checkNextPermutation(iter, "ie6", "false");
    checkNextPermutation(iter, "ie6", "true");
    checkNextPermutation(iter, "ie8", "false");
    checkNextPermutation(iter, "ie8", "true");
    checkNextPermutation(iter, "moz", "false");
View Full Code Here

      }

      ArtifactSet generatedArtifacts = new ArtifactSet();
      DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
          module, compilationState, generatedArtifacts,
          new PropertyPermutations(module.getProperties()), genDir,
          generatorResourcesDir);

      WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd(
          compilationState, rpo);
      PerfLogger.start("Precompile");
View Full Code Here

      }

      ArtifactSet generatorArtifacts = new ArtifactSet();
      DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
          module, compilationState, generatorArtifacts,
          new PropertyPermutations(module.getProperties()), genDir,
          generatorResourcesDir);

      WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd(
          compilationState, rpo);
      JavaToJavaScriptCompiler.precompile(logger, frontEnd, declEntryPts,
View Full Code Here

    precompilationOptions.setGenDir(null);
    compilerContext = compilerContextBuilder.options(precompilationOptions).build();

    ModuleDef module = ModuleDefLoader.loadFromClassPath(logger, compilerContext, moduleName);
    compilerContext = compilerContextBuilder.module(module).build();
    PropertyPermutations allPermutations = new PropertyPermutations(
        module.getProperties(), module.getActiveLinkerNames());
    List<PropertyPermutations> collapsedPermutations = allPermutations.collapseProperties();
    int[] perms = options.getPermsToCompile();
    if (perms == null) {
      perms = new int[collapsedPermutations.size()];
      for (int i = 0; i < perms.length; ++i) {
        perms[i] = i;
      }
    }

    logger = logger.branch(TreeLogger.INFO, "Compiling " + perms.length
        + " permutation" + (perms.length > 1 ? "s" : ""));
    for (int permId : perms) {
      /*
       * TODO(spoon,scottb): move Precompile out of the loop to run only once
       * per shard. Then figure out a way to avoid copying the generated
       * artifacts into every perm result on a shard.
       */
      PropertyPermutations onePerm = collapsedPermutations.get(permId);

      Precompilation precompilation =
          Precompile.precompile(logger, compilerContext, permId, onePerm);
      if (precompilation == null) {
        return false;
View Full Code Here

   * @return the precompilation
   * @throws UnableToCompleteException
   */
  public static Precompilation precompile(TreeLogger logger, CompilerContext compilerContext)
      throws UnableToCompleteException {
    PropertyPermutations allPermutations = new PropertyPermutations(
        compilerContext.getModule().getProperties(),
        compilerContext.getModule().getActiveLinkerNames());
    if (compilerContext.getOptions().isIncrementalCompileEnabled() && allPermutations.size() > 1) {
      logger.log(TreeLogger.ERROR,
          "Current binding properties are expanding to more than one permutation "
          + "but per-file compilation requires that each compile operate on only one permutation.");
      throw new UnableToCompleteException();
    }
View Full Code Here

      }

      ArtifactSet generatorArtifacts = new ArtifactSet();
      DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
          compilerContext, compilationState, generatorArtifacts,
          new PropertyPermutations(module.getProperties(), module.getActiveLinkerNames()));
      // Allow GC later.
      compilationState = null;
      // Never optimize on a validation run.
      jjsOptions.setOptimizePrecompile(false);
      getCompiler(module).precompile(
View Full Code Here

  /**
   * Create a list of all possible permutations configured for this module after
   * collapsing soft permutations.
   */
  static List<PropertyPermutations> getCollapsedPermutations(ModuleDef module) {
    PropertyPermutations allPermutations =
        new PropertyPermutations(module.getProperties(), module.getActiveLinkerNames());
    List<PropertyPermutations> collapsedPermutations = allPermutations.collapseProperties();
    return collapsedPermutations;
  }
View Full Code Here

TOP

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

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.