forked from java-decompiler/jd-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
68 lines (55 loc) · 1.73 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
apply plugin: 'java'
apply plugin: 'groovy'
dependencies {
compile 'org.codehaus.groovy:groovy:2.4.0'
compile 'org.codehaus.groovy:groovy-swing:2.4.0'
compile 'org.codehaus.groovy:groovy-xml:2.4.0'
compile 'com.fifesoft:rsyntaxtextarea:2.5.6'
compile 'jd:jd-core:0.7.1'
compile project(':api')
testCompile 'org.codehaus.groovy:groovy-test:2.4.0'
}
// ANTLR //
ext.antlr4 = [
antlrSource: 'src/main/antlr',
destinationDir: 'src-generated/antlr/java',
grammarPackage: 'org.jd.gui.util.parser.antlr'
]
configurations {
antlr4 {
description = "ANTLR4"
}
}
dependencies {
compile 'org.antlr:antlr4-runtime:4.5'
antlr4 'org.antlr:antlr4:4.5'
}
task antlr4OutputDir() {
mkdir antlr4.destinationDir
}
task antlr4GenerateGrammarSource(dependsOn: antlr4OutputDir, type: JavaExec) {
description = 'Generates Java sources from ANTLR4 grammars.'
inputs.dir file(antlr4.antlrSource)
outputs.dir file(antlr4.destinationDir)
def grammars = fileTree(antlr4.antlrSource).include('**/*.g4')
def pkg = antlr4.grammarPackage.replaceAll("\\.", "/")
main = 'org.antlr.v4.Tool'
classpath = configurations.antlr4
args = ['-o', "${antlr4.destinationDir}/${pkg}", '-package', antlr4.grammarPackage, grammars.files].flatten()
}
compileJava {
dependsOn antlr4GenerateGrammarSource
source antlr4.destinationDir
}
clean {
delete 'src-generated'
}
idea.module {
sourceDirs += file(antlr4.destinationDir)
}
ideaModule.dependsOn antlr4GenerateGrammarSource
eclipse.classpath.file.withXml { xml ->
def node = xml.asNode()
node.appendNode( 'classpathentry', [ kind: 'src', path: antlr4.destinationDir])
}
eclipseClasspath.dependsOn antlr4GenerateGrammarSource