private static boolean maybeOverrideConfig(ModuleDef module, String propName, String newValue) { ConfigurationProperty config = module.getProperties().findConfigProp(propName); if (config != null) { config.setValue(newValue); return true; } return false; }
/** * Sets a binding even if it's set to a different value in the GWT application. */ private static void overrideBinding(ModuleDef module, String propName, String newValue) { BindingProperty binding = module.getProperties().findBindingProp(propName); if (binding != null) { // This sets both allowed and generated values, which is needed since the module // might have explicitly disallowed the value. // It persists over multiple compiles but that's okay since we set it the same way // every time. binding.setValues(binding.getRootCondition(), newValue); } }
private static String chooseDefault(BindingProperty property, String... candidates) { for (String candidate : candidates) { if (property.isAllowedValue(candidate)) { return candidate; } } return property.getFirstAllowedValue(); }
@Override public void processModule(ModuleDef module) { computePropertiesMap(); if (properties.size() > 0) { Properties props = module.getProperties(); for (Property property : properties) { BindingProperty binding = props.createBinding(property.name()); if (!binding.isDefinedValue(property.value())) { binding.addDefinedValue(binding.getRootCondition(), property.value()); } binding.setValues( binding.getRootCondition(), property.value()); } } }
InputSummary(Map<String, String> bindingProperties, ModuleDef module) { this.bindingProperties = ImmutableMap.copyOf(bindingProperties); this.moduleLastModified = module.lastModified(); this.resourcesLastModified = module.getResourceLastModified(); this.filenameHash = module.getInputFilenameHash(); }
private CompilationState createCompilationState(ModuleDef moduleDef, CompilerContext compilerContext) throws UnableToCompleteException { TreeLogger treeLogger = GwtTreeLogger.get(); return moduleDef.getCompilationState(treeLogger, compilerContext); }
static boolean isValidJobId(String id) { return ModuleDef.isValidModuleName(id); }
/** * Dumps the binding property key/value pairs; For debugging use only. */ @Override public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0, j = orderedProps.length; i < j; i++) { sb.append(orderedProps[i].getName()).append(" = ").append( orderedPropValues[i]).append(" "); } return sb.toString(); }
public static String getModuleName(final GeneratorContext context) { try { return getModuleDef(context).getCanonicalName(); } catch (final Throwable t) { return null; } }
public String apply(ConfigurationProperty config) { return config.getName(); } };
/** * Sets a binding even if it's set to a different value in the GWT application. */ private static void overrideBinding(ModuleDef module, String propName, String newValue) { BindingProperty binding = module.getProperties().findBindingProp(propName); if (binding != null) { // This sets both allowed and generated values, which is needed since the module // might have explicitly disallowed the value. // It persists over multiple compiles but that's okay since we set it the same way // every time. binding.setValues(binding.getRootCondition(), newValue); } }
private static boolean maybeOverrideConfig(ModuleDef module, String propName, String newValue) { ConfigurationProperty config = module.getProperties().findConfigProp(propName); if (config != null) { config.setValue(newValue); return true; } return false; }
private static String chooseDefault(BindingProperty property, String... candidates) { for (String candidate : candidates) { if (property.isAllowedValue(candidate)) { return candidate; } } return property.getFirstAllowedValue(); }
private boolean isValidOutboxId(String id) { return ModuleDef.isValidModuleName(id); }
public static String getModuleName(final GeneratorContext context) { try { return getModuleDef(context).getCanonicalName(); } catch (final Throwable t) { return null; } }
public String apply(ConfigurationProperty config) { return config.getName(); } };
static boolean isValidJobId(String id) { return ModuleDef.isValidModuleName(id); }
private boolean isValidOutboxId(String id) { return ModuleDef.isValidModuleName(id); }
/** * The name of the module as passed to the compiler. Required. */ public void setInputModuleName(String inputModuleName) { Preconditions.checkArgument(ModuleDef.isValidModuleName(inputModuleName), "invalid module name: " + jobId); this.inputModuleName = inputModuleName; }
/** * The name of the module as passed to the compiler. Required. */ public void setInputModuleName(String inputModuleName) { Preconditions.checkArgument(ModuleDef.isValidModuleName(inputModuleName), "invalid module name: " + jobId); this.inputModuleName = inputModuleName; }