As GenJS has no reference to java.util classes, we need to comunicate via old good String[]
1.1 --- a/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/Bck2BrswrMojo.java Fri Nov 16 08:08:36 2012 +0100
1.2 +++ b/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/Bck2BrswrMojo.java Fri Nov 16 08:12:01 2012 +0100
1.3 @@ -74,10 +74,10 @@
1.4 URLClassLoader url = buildClassLoader(classes, prj.getDependencyArtifacts());
1.5
1.6 Class<?> c = Class.forName("org.apidesign.vm4brwsr.GenJS");
1.7 - Method m = c.getDeclaredMethod("compile", ClassLoader.class, Appendable.class, List.class);
1.8 + Method m = c.getDeclaredMethod("compile", ClassLoader.class, Appendable.class, String[].class);
1.9 m.setAccessible(true);
1.10 FileWriter w = new FileWriter(javascript);
1.11 - m.invoke(null, url, w, arr);
1.12 + m.invoke(null, url, w, arr.toArray(new String[0]));
1.13 w.close();
1.14 } catch (Exception ex) {
1.15 throw new MojoExecutionException("Can't compile", ex);
2.1 --- a/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Fri Nov 16 08:08:36 2012 +0100
2.2 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Fri Nov 16 08:12:01 2012 +0100
2.3 @@ -34,6 +34,9 @@
2.4 static void compile(Appendable out, String... names) throws IOException {
2.5 compile(out, StringArray.asList(names));
2.6 }
2.7 + static void compile(ClassLoader l, Appendable out, String... names) throws IOException {
2.8 + compile(l, out, StringArray.asList(names));
2.9 + }
2.10 static void compile(Appendable out, StringArray names) throws IOException {
2.11 compile(GenJS.class.getClassLoader(), out, names);
2.12 }