Package com.google.gwt.dev.cfg

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


   */
  private final List<File> toDelete = new ArrayList<File>();

  public StandardGeneratorContextTest() {
    CompilerContext compilerContext =
        new CompilerContext.Builder().module(new MockModuleDef()).build();
    try {
      mockCompilationState = CompilationStateBuilder.buildFrom(
          TreeLogger.NULL, compilerContext, Collections.<Resource> emptySet());
    } catch (UnableToCompleteException e) {
      throw new RuntimeException(e);
View Full Code Here


        RuntimeRebindRuleGenerator.RUNTIME_REBIND_RULE_SOURCES_BY_SHORT_NAME;
    MockLibraryWriter libraryWriter = new MockLibraryWriter();
    // A library group with a varied
    // user.agent/locale/BrowserShimGenerator/LocaleMessageGenerator configuration of properties
    // and generators.
    MockModuleDef module = new MockModuleDef();
    BindingProperty userAgentProperty = module.getProperties().createBinding("user.agent");
    userAgentProperty.addDefinedValue(userAgentProperty.getRootCondition(), "mozilla");
    userAgentProperty.addDefinedValue(userAgentProperty.getRootCondition(), "webkit");
    userAgentProperty.addDefinedValue(userAgentProperty.getRootCondition(), "ie");
    userAgentProperty.addDefinedValue(userAgentProperty.getRootCondition(), "webkit_phone");
    userAgentProperty.addDefinedValue(userAgentProperty.getRootCondition(), "webkit_tablet");
    BindingProperty flavorProperty = module.getProperties().createBinding("locale");
    flavorProperty.addDefinedValue(flavorProperty.getRootCondition(), "en");
    flavorProperty.addDefinedValue(flavorProperty.getRootCondition(), "fr");
    flavorProperty.addDefinedValue(flavorProperty.getRootCondition(), "ru");
    RuleGenerateWith browserShimGenerateRule = new RuleGenerateWith(BrowserShimGenerator.class);
    browserShimGenerateRule.getRootCondition()
        .getConditions().add(new ConditionWhenTypeEndsWith("Shim"));
    module.addRule(browserShimGenerateRule);
    RuleGenerateWith localeMessageGenerateRule = new RuleGenerateWith(LocaleMessageGenerator.class);
    localeMessageGenerateRule.getRootCondition()
        .getConditions().add(new ConditionWhenTypeEndsWith("Messages"));
    module.addRule(localeMessageGenerateRule);
    LibraryGroup libraryGroup = LibraryGroupTest.buildVariedPropertyGeneratorLibraryGroup(
        Sets.newHashSet("com.google.ChromeMessages"),
        Sets.newHashSet("com.google.WindowShim"));
    PrecompileTaskOptions options = new CompilerOptionsImpl();
    options.setFinalProperties(module.getProperties());
    compilerContext = new CompilerContext.Builder().libraryGroup(libraryGroup)
        .libraryWriter(libraryWriter).module(module).options(options).build();
    finishSetUpWithCompilerContext();

    // Analyzes properties and generators in the library group and watches output in the generator
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();

    RuntimeRebindRuleGenerator.RUNTIME_REBIND_RULE_SOURCES_BY_SHORT_NAME.clear();
    RuntimeRebindRuleGenerator.runtimeRebindRuleCount = 0;
    compilerContext = new CompilerContext.Builder().module(new MockModuleDef()).build();
    finishSetUpWithCompilerContext();
  }
View Full Code Here

TOP

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

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.