Compiling other JVM languages in Android Studio

80 views Asked by At

I'm trying to write Android applications in Frege and I currently have the gradle compiling the project after evaluation like this:

project.afterEvaluate {
    extensions.compileFrege = {
        description = 'Compile Frege to Java'
        javaexec {
            configurations.compile.resolve().each {
                classpath += files(it.toString())
                println it.toString()
            }
            main = 'frege.compiler.Main'
            def a = ['-j', '-target', '1.7', '-v', '-inline', '-d', 'src/main/java', '-make', '-sp', 'src/main/frege/io/github/mchav/freoquiz','src/main/frege/io/github/mchav/freoquiz' 
            println 'Frege compiler args: "' + a.join(' ') + '"'
            args (*a)
        }
    }
    compileFrege()
}

The problem with this is that it doesn't see the Android API (which I have to add manually to compile dependencies) and it can't use any of the aar files such as support because the compilations happens before they are "exploded." So I'd like to compile Frege files in place of Java files and set a default compiler for my project.

I imagine Android Studio, at some point, runs javac how can I replace it with a custom compile command?

0

There are 0 answers