Search in sources :

Example 6 with Arch

use of org.robovm.compiler.config.Arch in project robovm by robovm.

the class ClassCompiler method compile.

public void compile(Clazz clazz, Executor executor, ClassCompilerListener listener) throws IOException {
    reset();
    Arch arch = config.getArch();
    OS os = config.getOs();
    try {
        config.getLogger().info("Compiling %s (%s %s %s)", clazz, os, arch, config.isDebug() ? "debug" : "release");
        output.reset();
        compile(clazz, output);
    } catch (Throwable t) {
        if (t instanceof IOException) {
            throw (IOException) t;
        }
        if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        }
        throw new RuntimeException(t);
    }
    List<String> cCode = new ArrayList<>();
    cCode.addAll(bridgeMethodCompiler.getCWrapperFunctions());
    cCode.addAll(callbackMethodCompiler.getCWrapperFunctions());
    scheduleMachineCodeGeneration(executor, listener, config, clazz, output.toByteArray(), cCode);
}
Also used : OS(org.robovm.compiler.config.OS) ArrayList(java.util.ArrayList) Arch(org.robovm.compiler.config.Arch) IOException(java.io.IOException)

Aggregations

Arch (org.robovm.compiler.config.Arch)6 ArrayList (java.util.ArrayList)5 File (java.io.File)4 Config (org.robovm.compiler.config.Config)3 OS (org.robovm.compiler.config.OS)3 Path (org.robovm.compiler.clazz.Path)2 IOException (java.io.IOException)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Random (java.util.Random)1 TreeMap (java.util.TreeMap)1 TreeSet (java.util.TreeSet)1 ExecuteException (org.apache.commons.exec.ExecuteException)1 Clazz (org.robovm.compiler.clazz.Clazz)1 ClazzInfo (org.robovm.compiler.clazz.ClazzInfo)1 MethodInfo (org.robovm.compiler.clazz.MethodInfo)1 Resource (org.robovm.compiler.config.Resource)1 HashTableGenerator (org.robovm.compiler.hash.HashTableGenerator)1