forked from intellij-solidity/intellij-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
110 lines (85 loc) · 2.34 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.intellij" version "0.1.8"
id 'net.researchgate.release' version '2.4.0'
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'idea'
sourceCompatibility = 1.8
idea {
module {
generatedSourceDirs += file('gen')
}
}
sourceSets {
main {
java.srcDirs += 'gen'
}
}
clean.doFirst {
delete 'gen'
}
intellij {
pluginName 'Intellij-Solidity'
version '2016.3.2'
downloadSources Boolean.valueOf(true)
updateSinceUntilBuild = false
sandboxDirectory project.rootDir.canonicalPath + "/.sandbox"
systemProperties = ['compiler.process.debug.port': '21232']
}
repositories {
jcenter()
}
configurations {
lexer
parser
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile group: 'junit', name: 'junit', version: '4.11'
lexer files('lib/jflex-1.7.0-SNAPSHOT.jar') //'de.jflex:jflex:1.6.1'
parser files('lib/grammar-kit-1.5.0.jar')
}
release {
newVersionCommitMessage = '[Intellij-Solidity Release] - '
preTagCommitMessage = '[Intellij-Solidity Release] - pre tag commit: '
buildTasks = ['buildPlugin']
}
task codegen(dependsOn: ['lexer', 'parser']) {}
tasks.compileKotlin.dependsOn codegen
task lexer(type: JavaExec) {
def lexerName = "_SolidityLexer"
def pkg = "me/serce/solidity"
def src = "$project.projectDir/src/main/grammars/${lexerName}.flex"
def dst = "gen/$pkg"
new File(dst).mkdirs()
main = 'jflex.Main'
classpath configurations.lexer
args = ['--skel', 'src/main/grammars/idea-flex.skeleton', '-d', dst, src]
inputs.file file(src)
outputs.dir file("$dst/${lexerName}.java")
}
task parser(type: JavaExec) {
def pkg = 'me/serce/solidity/lang'
def dstRoot = "gen"
def src = "$project.projectDir/src/main/grammars/solidity.bnf"
def dst = "$dstRoot/$pkg"
doFirst {
delete file(dst)
}
main = 'org.intellij.grammar.Main'
classpath(configurations.compile + configurations.parser)
args = [dstRoot, file(src)]
inputs.file file(src)
outputs.dir dst
}