mirror of
https://github.com/revanced/smali.git
synced 2025-05-01 15:14:32 +02:00
Split out the build rule for the parser and tree walker
This commit is contained in:
parent
0dceb148f3
commit
87c1c0e054
@ -77,12 +77,25 @@ dependencies {
|
||||
proguard depends.proguard
|
||||
}
|
||||
|
||||
task generateAntlrSource(type: JavaExec) {
|
||||
task generateParserAntlrSource(type: JavaExec) {
|
||||
inputs.dir file(antlrSource)
|
||||
outputs.dir file(antlrOutput)
|
||||
|
||||
mkdir(antlrOutput)
|
||||
def grammars = fileTree(antlrSource).include('**/*.g')
|
||||
def grammars = fileTree(antlrSource).include('**/smaliParser.g')
|
||||
|
||||
classpath = configurations.antlr3
|
||||
main = 'org.antlr.Tool'
|
||||
args '-fo', relativePath("${antlrOutput}/org/jf/smali")
|
||||
args grammars.files
|
||||
}
|
||||
|
||||
task generateTreeWalkerAntlrSource(type: JavaExec) {
|
||||
inputs.dir file(antlrSource)
|
||||
outputs.dir file(antlrOutput)
|
||||
|
||||
mkdir(antlrOutput)
|
||||
def grammars = fileTree(antlrSource).include('**/smaliTreeWalker.g')
|
||||
|
||||
classpath = configurations.antlr3
|
||||
main = 'org.antlr.Tool'
|
||||
@ -117,7 +130,7 @@ task generateJflexSource(type: JavaExec) {
|
||||
args grammars.files.join(' ')
|
||||
}
|
||||
|
||||
compileJava.dependsOn generateAntlrSource, generateJflexSource
|
||||
compileJava.dependsOn generateParserAntlrSource, generateTreeWalkerAntlrSource, generateJflexSource
|
||||
compileTestJava.dependsOn generateTestAntlrSource
|
||||
|
||||
// build a jar containing all dependencies
|
||||
|
Loading…
x
Reference in New Issue
Block a user