Package com.google.gwt.dev.cfg

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


   * shards.
   */
  private boolean doLinkFinal(TreeLogger logger, File compilerWorkDir,
      ModuleDef module, JJSOptions precompileOptions)
      throws UnableToCompleteException {
    int numPermutations = new PropertyPermutations(module.getProperties(),
        module.getActiveLinkerNames()).collapseProperties().size();
    List<File> resultFiles = new ArrayList<File>(numPermutations);
    for (int i = 0; i < numPermutations; ++i) {
      File f = CompilePerms.makePermFilename(compilerWorkDir, i);
      if (!f.exists()) {
View Full Code Here


    typeOracle = module.getTypeOracle(logger);
    sourceOracle = new StandardSourceOracle(typeOracle);
    declEntryPts = module.getEntryPointTypeNames();
    rebindPermOracle = new DistillerRebindPermutationOracle();
    properties = module.getProperties();
    perms = new PropertyPermutations(properties);
    WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd(
        sourceOracle, rebindPermOracle);
    jjs = new JavaToJavaScriptCompiler(logger, frontEnd, declEntryPts,
        obfuscate, prettyNames);
    initCompilations(logger);
View Full Code Here

      return moduleDef;
   }

   protected PropertyOracle getPropertyOracle() {
      if (propertyOracle == null) {
         PropertyPermutations permutations = new PropertyPermutations(moduleDef.getProperties(),
                  moduleDef.getActiveLinkerNames());

         SortedSet<ConfigurationProperty> configPropSet = moduleDef.getProperties().getConfigurationProperties();
         ConfigurationProperty[] configProps = configPropSet.toArray(new ConfigurationProperty[configPropSet.size()]);

         BindingProperty[] orderedProperties = permutations.getOrderedProperties();

         WithProperties withProperties = GwtTestDataHolder.get().getCurrentWithProperties();

         String[] processedProperties;
         if (withProperties != null) {
            processedProperties = replaceOrderedPropertyValues(orderedProperties,
                     permutations.getOrderedPropertyValues(0), withProperties);
         } else {
            processedProperties = permutations.getOrderedPropertyValues(0);
         }

         propertyOracle = new StaticPropertyOracle(orderedProperties, processedProperties,
                  configProps);
      }
View Full Code Here

   * shards. Returns true if successful.
   */
  private boolean doLinkFinal(TreeLogger logger, File compilerWorkDir, ModuleDef module,
      ResourceOracle publicResourceOracle, PrecompileTaskOptions precompileOptions)
      throws UnableToCompleteException {
    int numPermutations = new PropertyPermutations(module.getProperties(),
        module.getActiveLinkerNames()).collapseProperties().size();
    List<File> resultFiles = new ArrayList<File>(numPermutations);
    for (int i = 0; i < numPermutations; ++i) {
      File f = CompilePerms.makePermFilename(compilerWorkDir, i);
      if (!f.exists()) {
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());
    return precompile(logger, compilerContext, 0, allPermutations);
  }
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

         */
        TreeLogger branch =
            logger.branch(TreeLogger.INFO, "Precompiling (minimal) module " + module.getName());
        Util.writeObjectAsFile(logger, precompilationFile, options);
        int numPermutations =
            new PropertyPermutations(module.getProperties(), module.getActiveLinkerNames())
                .collapseProperties().size();
        Util.writeStringAsFile(logger, new File(compilerWorkDir, PERM_COUNT_FILENAME), String
            .valueOf(numPermutations));
        if (branch.isLoggable(TreeLogger.INFO)) {
          branch.log(TreeLogger.INFO,
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

    // Only precompile specified permutations
    List<PropertyPermutations> collapsedPermutations =
      Precompile.getCollapsedPermutations(module);

    PropertyPermutations onePerm = collapsedPermutations.get(permId);
    Precompilation precompilation = Precompile.precompile(branch, compilerContext, permId, onePerm);
    if (precompilation == null) {
      branch.log(TreeLogger.ERROR, "Precompilation failed");
      return false;
    }
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.