Open welopino opened 7 years ago
And the same problem with the original from the reference:
Run.java
package run;
import com.redhat.ceylon.compiler.java.runtime.tools.*;
import java.io.File;
public class Run {
public void run(){
CompilerOptions options = new CompilerOptions();
options.addModule("c");
CompilationListener listener = new CompilationListener(){
@Override
public void error(File file, long line, long column, String message){
System.out.println("error");
}
@Override
public void warning(File file, long line, long column, String message){
System.out.println("warning");
}
@Override
public void moduleCompiled(String module, String version){
System.out.println("moduleCompiled");
}
};
com.redhat.ceylon.compiler.java.runtime.tools.Compiler jvmCompiler = CeylonToolProvider.getCompiler(Backend.Java);
jvmCompiler.compile(options, listener);
}
}
module.ceylon
native("jvm") module run "1.0.0" {
native("jvm") import java.base "8";
native("jvm") import com.redhat.ceylon.tool.provider "1.3.2";
native("jvm") import com.redhat.ceylon.compiler.java "1.3.2";
}
package.ceylon:
shared package run;
run.ceylon:
shared void run(){
Run().run();
}
No callback is fired - it doesnt do anything.
@FroMage this is really a usage question for you, I guess. Can you take a look and tell @welopino what he's doing wrong?
The expample on page Starting a Ceylon module from the JVM - in the section about: Compiling a Ceylon module for both backends - that shows how to compile a module programmatically doesnt fire any method of the listener nor does it seem to compile anything. (ceylon 1.3.2)
Here a ceylon version:
I expect at least one of the three alternative results to be fired on the listener - even in case of a wrong working directory or non-existing "module.to.compile".