Skip to content

Instantly share code, notes, and snippets.

@mariusk
Created February 27, 2014 14:20
Show Gist options
  • Save mariusk/9250960 to your computer and use it in GitHub Desktop.
Save mariusk/9250960 to your computer and use it in GitHub Desktop.
public class KawaCompileTask extends DefaultTask {
@InputFiles
Set<File> source = [] as Set;
String classpath;
@TaskAction
void compile() {
println "compiling kawa sources..."
project.exec {
//enviroment["CLASSPATH"] = classpath
executable = "kawa"
List <File> files = source.collect { File source ->
if (!source.isDirectory())
return source
return project.fileTree(source) {
include "**/*.scm"
}.files
}.flatten()
println "found: "+files.size()
if (files.size() == 0)
return 0
args "-d", outputDir, "-C"
args += files
println "args: "+args
}
}
}
task kawacompile(type: KawaCompileTask) {
classpath = "/opt/android-studio/sdk//platforms/android-19/android.jar"
source += file("src/main/kawa")
outputDir = file("$buildDir/kawa")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment