Package com.google.gwt.dev.javac

Examples of com.google.gwt.dev.javac.CompilationState


  @Override
  public void setUp() throws Exception {
    super.setUp();
    logger = createCompileLogger();
    CompilationState state =
        CompilationStateBuilder.buildFrom(logger, new CompilerContext(), getJavaResources());
    types = state.getTypeOracle();
    rfedType = types.findType(RequestFactoryEditorDriver.class.getName());
    assertNotNull(rfedType);
  }
View Full Code Here


        return code;
      }
    });

    CompilerContext compilerContext = provideCompilerContext();
    CompilationState state =
        CompilationStateBuilder.buildFrom(logger, compilerContext,
            sourceOracle.getResources(), getAdditionalTypeProviderDelegate());
    ConfigProps config = new ConfigProps(Lists.newArrayList(configProps));

    jProgram =
View Full Code Here

            return false;
          }
        }).compileMonolithic(compileMonolithic).build();
    compilerContext.getOptions().setSourceLevel(sourceLevel);
    compilerContext.getOptions().setStrict(true);
    CompilationState state =
        CompilationStateBuilder.buildFrom(logger, compilerContext,
            sourceOracle.getResources(), getAdditionalTypeProviderDelegate());
    JProgram program =
        JavaAstConstructor.construct(logger, state, compilerContext.getOptions(),
            null, "test.EntryPoint", "com.google.gwt.lang.Exceptions");
View Full Code Here

        .minimalRebuildCache(new MinimalRebuildCache()).build();

    ConfigProps config = new ConfigProps(Arrays.asList(recordFileNamesProp,
        recordLineNumbersProp));

    CompilationState state =
        CompilationStateBuilder.buildFrom(logger, context,
            sourceOracle.getResources(), null);
    JProgram jProgram = AstConstructor.construct(logger, state, options, config);
    jProgram.addEntryMethod(findMethod(jProgram, "onModuleLoad"));
View Full Code Here

        code.append("}");
        return code;
      }
    });

    CompilationState state;
    try {
      state = CompilationStateBuilder.buildFrom(logger, new CompilerContext(), javaResources);
    } catch (UnableToCompleteException e) {
        throw new RuntimeException(e);
    }

    UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
    builder.setLowestLogLevel(TreeLogger.ERROR);
    for (String expectedMsg : expected) {
      builder.expectError(expectedMsg, null);
    }
    builder.expectError(RequestFactoryModel.poisonedMessage(), null);
    UnitTestTreeLogger testLogger = builder.createLogger();
    try {
      new RequestFactoryModel(testLogger, state.getTypeOracle().findType(
          "t.TestRequestFactory"));
      fail("Should have complained");
    } catch (UnableToCompleteException e) {
    }
    testLogger.assertCorrectLogEntries();
View Full Code Here

   */
  public static Precompilation precompile(TreeLogger logger,
      JJSOptions jjsOptions, ModuleDef module, File genDir,
      File generatorResourcesDir) {
    try {
      CompilationState compilationState = module.getCompilationState(logger);

      String[] declEntryPts = module.getEntryPointTypeNames();
      if (declEntryPts.length == 0) {
        logger.log(TreeLogger.ERROR, "Module has no entry points defined", null);
        throw new UnableToCompleteException();
View Full Code Here

   * @param generatorResourcesDir required directory to dump generator resources
   */
  public static boolean validate(TreeLogger logger, JJSOptions jjsOptions,
      ModuleDef module, File genDir, File generatorResourcesDir) {
    try {
      CompilationState compilationState = module.getCompilationState(logger);

      String[] declEntryPts = module.getEntryPointTypeNames();
      String[] additionalRootTypes = null;
      if (declEntryPts.length == 0) {
        // No declared entry points, just validate all visible classes.
        Set<CompilationUnit> compilationUnits = compilationState.getCompilationUnits();
        additionalRootTypes = new String[compilationUnits.size()];
        int i = 0;
        for (CompilationUnit unit : compilationUnits) {
          additionalRootTypes[i++] = unit.getTypeName();
        }
View Full Code Here

    return name;
  }

  public CompilationState getCompilationState(TreeLogger logger) {
    if (lazyCompilationState == null) {
      lazyCompilationState = new CompilationState(logger, lazyJavaSourceOracle);
    }
    return lazyCompilationState;
  }
View Full Code Here

    resources.add(PARENT);
    resources.add(PARENT_INT);
    resources.add(CHILD);
    resources.add(CHILD_INT);
    TreeLogger logger = new FailErrorLogger();
    CompilationState state =
        CompilationStateBuilder.buildFrom(logger, new CompilerContext(), resources);
    typeOracle = state.getTypeOracle();
    foo = typeOracle.getType("my.Foo");
    bar = typeOracle.getType("my.Bar");
    baz = typeOracle.getType("my.Baz");
    parent = typeOracle.getType("my.Parent");
    parentInt = typeOracle.getType("my.ParentInt");
View Full Code Here

    resources.add(FOO);
    resources.add(FOOISH);
    resources.add(BAR);
    resources.add(RENDERER);
    resources.add(BINDER);
    CompilationState state =
        CompilationStateBuilder.buildFrom(createCompileLogger(), new CompilerContext(), resources);
    types = state.getTypeOracle();
    logger = new MockMortalLogger();
    fieldManager = new FieldManager(types, logger, true);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.CompilationState

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.