Package com.google.gwt.dev.javac

Examples of com.google.gwt.dev.javac.StandardGeneratorContext$GeneratedUnitImpl


   * compilation).
   */
  public static Set<String> findTranslatablePackagesInModule(final GeneratorContext context) {
    final Set<String> packages = new HashSet<String>();
    try {
      final StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
      final Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      final Object o = field.get(stdContext);

      final ModuleDef moduleDef = (ModuleDef) o;
View Full Code Here


         Rules rules = module.getRules();
         PrecompileTaskOptionsImpl options = new PrecompileTaskOptionsImpl();
         options.setGenDir(genDir);
         CompilerContext compilerContext = new CompilerContext.Builder().module(module).options(
                  options).build();
         StandardGeneratorContext genCtx = new StandardGeneratorContext(compilerContext,
                  compilationState, new ArtifactSet(), false);

         // Only enable generator result caching if we have a valid rebindCache
         genCtx.setGeneratorResultCachingEnabled(rebindCache != null);

         rebindOracle = new StandardRebindOracle(propOracle, rules, genCtx);
         rebindOracle.setRebindCache(rebindCache);
      } finally {
         moduleSpaceHostReadyEvent.end();
View Full Code Here

     * Try to determine the module package -- hackishly
     */
    //TODO: Find a more standard way to do this.
    try {
      if (context instanceof StandardGeneratorContext) {
        StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
        Field field = StandardGeneratorContext.class.getDeclaredField("module");
        field.setAccessible(true);

        ModuleDef moduleDef = (ModuleDef) field.get(stdContext);

View Full Code Here

    ModuleDef module = compilerContext.getModule();
    this.compilationState = compilationState;
    permutations = new Permutation[perms.size()];
    propertyOracles = new StaticPropertyOracle[perms.size()];
    rebindOracles = new RebindOracle[perms.size()];
    generatorContext = new StandardGeneratorContext(
        compilerContext, compilationState, generatorArtifacts, true);
    BindingProperty[] orderedProps = perms.getOrderedProperties();
    SortedSet<ConfigurationProperty> configPropSet = module.getProperties().getConfigurationProperties();
    ConfigurationProperty[] configProps = configPropSet.toArray(new ConfigurationProperty[configPropSet.size()]);
    Rules rules = module.getRules();
View Full Code Here

    void buildPropertyProviderRegistrator(Set<String> allRootTypes,
        SortedSet<BindingProperty> bindingProperties,
        SortedSet<ConfigurationProperty> configurationProperties) throws UnableToCompleteException {
      PropertyProviderRegistratorGenerator propertyProviderRegistratorGenerator =
          new PropertyProviderRegistratorGenerator(bindingProperties, configurationProperties);
      StandardGeneratorContext generatorContext = getGeneratorContext();
      // Name based on module canonical name, to avoid collisions resulting from multiple modules
      // with the same rename.
      String propertyProviderRegistratorTypeName = propertyProviderRegistratorGenerator.generate(
          logger, generatorContext, module.getCanonicalName());
      // Ensures that unification traverses and keeps the class.
      allRootTypes.add(propertyProviderRegistratorTypeName);
      // Ensures that JProgram knows to index this class's methods so that later bootstrap
      // construction code is able to locate the FooPropertyProviderRegistrator.register() function.
      jprogram.addIndexedTypeName(propertyProviderRegistratorTypeName);
      jprogram.setPropertyProviderRegistratorTypeSourceName(propertyProviderRegistratorTypeName);
      generatorContext.finish(logger);
    }
View Full Code Here

        return;
      }

      RuntimeRebindRegistratorGenerator runtimeRebindRegistratorGenerator =
          new RuntimeRebindRegistratorGenerator();
      StandardGeneratorContext generatorContext = getGeneratorContext();
      // Name based on module canonical name, to avoid collisions resulting from multiple modules
      // with the same rename.
      String runtimeRebindRegistratorTypeName = runtimeRebindRegistratorGenerator.generate(logger,
          generatorContext, module.getCanonicalName());
      // Ensures that unification traverses and keeps the class.
      allRootTypes.add(runtimeRebindRegistratorTypeName);
      // Ensures that JProgram knows to index this class's methods so that later bootstrap
      // construction code is able to locate the FooRuntimeRebindRegistrator.register() function.
      jprogram.addIndexedTypeName(runtimeRebindRegistratorTypeName);
      jprogram.setRuntimeRebindRegistratorTypeName(runtimeRebindRegistratorTypeName);
      generatorContext.finish(logger);
    }
View Full Code Here

    }
  }

  private static ModuleDef getModuleDef(final GeneratorContext context) {
    try {
      final StandardGeneratorContext standardGeneratorContext =
          (StandardGeneratorContext) context;

      Field moduleField = StandardGeneratorContext.class.getDeclaredField("module");
      moduleField.setAccessible(true);
      return (ModuleDef) moduleField.get(standardGeneratorContext);
View Full Code Here

   * compilation).
   */
  public static Set<String> findTranslatablePackagesInModule(final GeneratorContext context) {
    final Set<String> packages = new HashSet<String>();
    try {
      final StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
      final Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      final Object o = field.get(stdContext);

      final ModuleDef moduleDef = (ModuleDef) o;
View Full Code Here

        CompilationState compilationState, ArtifactSet generatorArtifacts,
        PropertyPermutations perms, File genDir, File generatorResourcesDir) {
      permutations = new Permutation[perms.size()];
      propertyOracles = new StaticPropertyOracle[perms.size()];
      rebindOracles = new RebindOracle[perms.size()];
      generatorContext = new StandardGeneratorContext(compilationState, module,
          genDir, generatorResourcesDir, generatorArtifacts);
      BindingProperty[] orderedProps = perms.getOrderedProperties();
      SortedSet<ConfigurationProperty> configPropSet = module.getProperties().getConfigurationProperties();
      ConfigurationProperty[] configProps = configPropSet.toArray(new ConfigurationProperty[configPropSet.size()]);
      Rules rules = module.getRules();
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.StandardGeneratorContext$GeneratedUnitImpl

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.