forked from intellij-solidity/intellij-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (104 loc) · 3.05 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io'}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.grammarkit" version "2020.1.4"
id 'org.jetbrains.intellij' version '0.4.21'
id 'net.researchgate.release' version '2.8.1'
}
apply plugin: 'java'
apply plugin: 'org.jetbrains.grammarkit'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'idea'
apply plugin: 'jacoco'
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = 1.8
}
idea {
module {
generatedSourceDirs += file('gen')
}
}
sourceSets {
main {
java.srcDirs += 'gen'
}
}
clean.doFirst {
delete 'gen'
}
intellij {
pluginName 'Intellij-Solidity'
version '2020.1.1'
downloadSources true
updateSinceUntilBuild = false
// TODO(sergey): remove
plugins = [
'java',
]
sandboxDirectory project.rootDir.canonicalPath + "/.sandbox"
}
repositories {
jcenter()
}
configurations {
lexer
parser
runtime.exclude group: "org.slf4j" // IntelliJ uses slf4j which results in a class loader conflict
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "io.sentry:sentry:$sentry_version"
// https://mvnrepository.com/artifact/org.ethereum/ethereumj-core
compileOnly( group: 'org.ethereum', name: 'ethereumj-core', version: '1.7.0-RELEASE') {
exclude group: 'org.ethereum', module: 'solcJ-all'
exclude group: 'org.ethereum', module: 'rocksdbjni'
}
def web3jVersion = "4.0.1"
compile group: 'org.web3j', name: 'core', version: web3jVersion
compile group: 'org.web3j', name: 'codegen', version: web3jVersion
compile group: 'org.web3j', name: 'abi', version: web3jVersion
testCompile group: 'junit', name: 'junit', version: '4.11'
}
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: org.jetbrains.grammarkit.tasks.GenerateLexer) {
def lexerName = "_SolidityLexer"
source = "$project.projectDir/src/main/grammars/${lexerName}.flex"
targetDir = "gen/me/serce/solidity"
targetClass = "$lexerName"
skeleton = 'src/main/grammars/idea-flex.skeleton'
purgeOldFiles = true
}
task parser(type: org.jetbrains.grammarkit.tasks.GenerateParser) {
dependsOn lexer
def pkg = 'me/serce/solidity'
source = "$project.projectDir/src/main/grammars/solidity.bnf"
targetRoot = 'gen'
pathToParser = "$pkg/SolidityParser.java"
pathToPsiRoot = "$pkg/psi"
purgeOldFiles = true
outputs.dir(new File("$targetRoot/$pkg"))
}
// codecov
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport