public void saveTo(File file, String renameTo) { boolean absoluteFile = renameTo.endsWith(".gwt.xml"); if (absoluteFile) { renameTo = renameTo.substring(0, renameTo.length() - 8); } boolean rename = !renameTo.replace('/', '.').equals(module.getInheritName()); final String inheritName; if (rename) { final String pkg, name; int ind = renameTo.lastIndexOf('.'); boolean moveToPackage = ind > -1; if (moveToPackage) { pkg = renameTo.substring(0, ind).replace('.', '/'); name = renameTo.substring(ind + 1); } else { pkg = ""; name = renameTo; } if (pkg.length() == 0) { inheritName = name; } else { if (file.isDirectory()) { File f = new File(file, pkg); f.mkdirs(); f.deleteOnExit(); file = f; } inheritName = pkg + (pkg.length() == 0 ? "" : ".") + name; } } else { inheritName = renameTo; } }
public GwtcContext(GwtcService gwtcService, ClassLoader resourceLoader) { this.gwtcService = gwtcService; // Start scanning the classpath, but don't block until we need to. final Callable<ClasspathResourceMap> scanner = X_Scanner.scanClassloaderAsync(resourceLoader); classpath = new SingletonProvider<ClasspathResourceMap>() { @Override protected ClasspathResourceMap initialValue() { try { return scanner.call(); } catch (Exception e) { throw X_Debug.rethrow(e); } } }; String genName = "Gwtc" + Math.abs(hashCode() - System.nanoTime()); module = new GwtcXmlBuilder("", genName, false); module.addConfigurationProperty("xsiframe.failIfScriptTag", "FALSE"); module.setPublic("public"); }
public void setRenameTo(String renameTo) { module.setRenameTo(renameTo); }
public XmlBuffer getGwtXml() { return module.getBuffer(); }
public void addGwtXmlInherit(String value) { module.addInherit(value); }
public void addGwtXmlSource(String genPrefix) { module.addSource(genPrefix); }
public void setEntryPoint(String qualifiedName) { module.setEntryPoint(qualifiedName); }
public String getGenName() { return module.getInheritName(); }
public void inheritGwtXml(String inherit) { module.inherit(inherit); }
public void saveTo(File file) { saveTo(file, module.getInheritName()); }
public String generateGwtXml(Gwtc gwtc, String pkg, String name) { xml = GwtcXmlBuilder.generateGwtXml(gwtc, pkg, name); return xml.getInheritName(); }