Fix up the gradle build

This commit is contained in:
Ben Gruver 2015-03-01 22:47:59 -08:00
parent 8c1d8ddef2
commit c5cf51ac69

View File

@ -59,27 +59,36 @@ idea {
excludeDirs.remove(sourceDir); excludeDirs.remove(sourceDir);
} }
} }
iml {
withXml {
it.node.@type = "PLUGIN_MODULE"
}
}
} }
} }
// We can't actually compile the plugin with gradle, so we just disable everything // We can't actually compile the plugin with gradle, so we just disable everything
// except the tasks related to generating the IDEA module and ANTLR parser // except the tasks related to generating the IDEA module and ANTLR parser
tasks.all { tasks.all {
if (name != 'idea' && name != 'ideaModule' && name != 'generateParserAntlrSource') { if (!(name in ['idea', 'ideaModule', 'generateParserAntlrSource', 'clean'])) {
enabled = false enabled = false
} }
} }
task generateParserAntlrSource(type: JavaExec) { task generateParserAntlrSource(type: JavaExec, dependsOn: ":smali:generateGrammarSource") {
def smaliOutputDir = file(relativePath(project.parent.childProjects.get('smali')
.generateGrammarSource.outputDirectory))
inputs.file new File(smaliOutputDir, "smaliParser.tokens")
inputs.dir file(antlrSource) inputs.dir file(antlrSource)
outputs.dir file(antlrOutput) outputs.dir file(antlrOutput)
mkdir(antlrOutput) file(antlrOutput).mkdirs()
def grammars = fileTree(antlrSource).include('**/smalideaParser.g')
classpath = configurations.antlr3 classpath = configurations.antlr3
main = 'org.antlr.Tool' main = 'org.antlr.Tool'
args '-fo', relativePath("${antlrOutput}/org/jf/smalidea") args '-fo', relativePath("${antlrOutput}/org/jf/smalidea")
args '-lib', relativePath(project.parent.childProjects.get('smali').antlrOutput) + "/org/jf/smali" args '-lib', smaliOutputDir
args grammars.files args new File(antlrSource, "smalideaParser.g")
} }