Package com.google.gwt.dev

Examples of com.google.gwt.dev.CompilerContext$Builder


  }

  public static TypeOracle buildTypeOracle(TreeLogger logger,
      Set<Resource> resources, Set<GeneratedUnit> generatedUnits) {
    try {
      CompilerContext compilerContext = new CompilerContext();
      compilerContext.getOptions().setStrict(true);
      CompilationState state =
          CompilationStateBuilder.buildFrom(logger, compilerContext, resources);
      state.addGeneratedCompilationUnits(logger, generatedUnits);
      return state.getTypeOracle();
    } catch (UnableToCompleteException e) {
View Full Code Here


    sourceOracle.add(additionalResources);

    PrecompileTaskOptions options = new PrecompileTaskOptionsImpl();
    options.setOutput(JsOutputOption.PRETTY);
    options.setRunAsyncEnabled(false);
    CompilerContext context = new CompilerContext.Builder().options(options)
        .minimalRebuildCache(new MinimalRebuildCache()).build();

    ConfigProps config = new ConfigProps(Arrays.asList(recordFileNamesProp,
        recordLineNumbersProp));
View Full Code Here

  public void testGenerate() throws UnableToCompleteException {
    // Sets up environment.
    Map<String, String> runtimeRebindRuleSourcesByName =
        RuntimeRebindRuleGenerator.RUNTIME_REBIND_RULE_SOURCES_BY_SHORT_NAME;
    MockModuleDef moduleDef = new MockModuleDef();
    CompilerContext compilerContext = new CompilerContext.Builder().module(moduleDef).build();

    MockGeneratorContext generatorContext = new MockGeneratorContext(
        compilerContext, CompilationStateBuilder.buildFrom(
            TreeLogger.NULL, compilerContext, Sets.<Resource>newHashSet()), null, true, false);
    Properties moduleProperties = new Properties();
View Full Code Here

    // Keep a copy so that we can check that the one passed-in isn't mutated
    Map<String, CompiledClass> knownValidClasses =
        new HashMap<String, CompiledClass>(validClasses);

    // Collect more compilation errors where extra units are thrown out by unit invalidation.
    CompilerContext compilerContext = new CompilerContext.Builder().build();

    // Invoke the method under test
    CompilationUnitInvalidator.retainValidUnits(TreeLogger.NULL, units, validClasses,
        compilerContext.getLocalCompilationErrorsIndex());

    // Check that the compilation errors index was correctly populated.
    UnitTestTreeLogger.Builder loggerBuilder = new UnitTestTreeLogger.Builder();
    loggerBuilder.setLowestLogLevel(TreeLogger.TRACE);
    loggerBuilder.expectTrace("Tracing compile failure path for type 'bad6'", null);
View Full Code Here

      }
    });

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

    UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
View Full Code Here

    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");
View Full Code Here

    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

  @Override
  public void setUp() throws Exception {
    super.setUp();
    CompilationState state = CompilationStateBuilder.buildFrom(
        createCompileLogger(), new CompilerContext(), UiJavaResources.getUiResources());
    types = state.getTypeOracle();
    logger = new MockMortalLogger();
    init(DesignTimeUtilsStub.EMPTY,
        "<doc><elm attr1=\"attr1Value\" attr2=\"attr2Value\"/></doc>");
  }
View Full Code Here

  @Override
  public void setUp() throws Exception {
    super.setUp();
    CompilationState state = CompilationStateBuilder.buildFrom(
        createCompileLogger(), new CompilerContext(), UiJavaResources.getUiResources());
    types = state.getTypeOracle();
  }
View Full Code Here

    resources.add(UI_STYLE);
    resources.add(FOO);
    resources.add(rendererClass);
    resources.addAll(Arrays.asList(otherClasses));
    CompilationState state =
        CompilationStateBuilder.buildFrom(createCompileLogger(), new CompilerContext(), resources);
    types = state.getTypeOracle();
    logger = new MockMortalLogger();
    UiBinderContext uiBinderCtx = new UiBinderContext();
    fieldManager = new FieldManager(types, logger, true);
    String baseClass = RENDERER_BASE_CLASS_NAME;
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.CompilerContext$Builder

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.