Browse Source

widget packaging

svn changeset:9093/svn branch:2009-09-widget-packaging_3332
tags/6.7.0.beta1
Matti Tahvonen 14 years ago
parent
commit
eebf12833e

+ 11
- 0
src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java View File

String pathSep = System.getProperty("path.separator"); String pathSep = System.getProperty("path.separator");
String classpath = System.getProperty("java.class.path"); String classpath = System.getProperty("java.class.path");


if (classpath.startsWith("\"")) {
classpath = classpath.substring(1);
}
if (classpath.endsWith("\"")) {
classpath = classpath.substring(0, classpath.length() - 1);
}

System.err.println("Classpath: " + classpath);

String[] split = classpath.split(pathSep); String[] split = classpath.split(pathSep);
for (int i = 0; i < split.length; i++) { for (int i = 0; i < split.length; i++) {
String classpathEntry = split[i]; String classpathEntry = split[i];
url = new URL("jar:" + url.toExternalForm() + "!/"); url = new URL("jar:" + url.toExternalForm() + "!/");
JarURLConnection conn = (JarURLConnection) url JarURLConnection conn = (JarURLConnection) url
.openConnection(); .openConnection();
System.out.println(url);
JarFile jarFile = conn.getJarFile(); JarFile jarFile = conn.getJarFile();
Manifest manifest = jarFile.getManifest(); Manifest manifest = jarFile.getManifest();
Attributes mainAttributes = manifest.getMainAttributes(); Attributes mainAttributes = manifest.getMainAttributes();
if (mainAttributes.getValue("Vaadin-Widgetsets") != null) { if (mainAttributes.getValue("Vaadin-Widgetsets") != null) {
System.err.println("Accepted jar file" + url);
return true; return true;
} }
} catch (MalformedURLException e) { } catch (MalformedURLException e) {

+ 3
- 0
src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java View File

} }


} }
logger.log(Type.INFO,
"Widget set will contain implementations for following components: "
+ paintablesHavingWidgetAnnotation.toString());
} }


/** /**

+ 9
- 0
src/com/vaadin/tools/WidgetsetCompiler.java View File

import java.lang.reflect.Method; import java.lang.reflect.Method;
import com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder;
/** /**
* A wrapper for the GWT 1.6 compiler that runs the compiler in a new thread. * A wrapper for the GWT 1.6 compiler that runs the compiler in a new thread.
* *
try { try {
// GWTCompiler.main(args); // GWTCompiler.main(args);
// avoid warnings // avoid warnings
String wsname = args[args.length - 1];
// TODO expecting this is launched via eclipse WTP
// project
WidgetSetBuilder.updateWidgetSet(wsname, "src");
System.setProperty("gwt.nowarn.legacy.tools", "true"); System.setProperty("gwt.nowarn.legacy.tools", "true");
Class<?> compilerClass = Class Class<?> compilerClass = Class
.forName("com.google.gwt.dev.GWTCompiler"); .forName("com.google.gwt.dev.GWTCompiler");

Loading…
Cancel
Save