forked from Skydev0h/intellij-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (114 loc) · 3.61 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
132
133
134
135
136
137
138
139
140
141
142
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io'}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.grammarkit" version "2021.1.3"
// Avoid 1.5.3 due to issues with hot reloading, see https://github.com/JetBrains/gradle-intellij-plugin/issues/959
id "org.jetbrains.intellij" version "1.5.2"
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 = 11
targetCompatibility = 11
compileKotlin {
kotlinOptions.jvmTarget = 11
}
idea {
module {
generatedSourceDirs += file('gen')
}
}
sourceSets {
main {
java.srcDirs += 'gen'
}
}
clean.doFirst {
delete 'gen'
}
intellij {
pluginName = 'Intellij-Solidity'
version = '2021.1.3'
downloadSources = true
updateSinceUntilBuild = false
// TODO(sergey): remove
plugins = [
'java',
]
sandboxDir = project.rootDir.canonicalPath + "/.sandbox"
}
runIde {
maxHeapSize = "1G"
}
repositories {
mavenCentral()
// ethereumj isn't available on maven central
jcenter()
maven { url "https://www.jetbrains.com/intellij-repository/releases" }
maven { url "https://cache-redirector.jetbrains.com/intellij-dependencies" }
}
configurations {
lexer
parser
runtime.exclude group: "org.slf4j" // IntelliJ uses slf4j which results in a class loader conflict
implementation.exclude group: "org.slf4j" // IntelliJ uses slf4j which results in a class loader conflict
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation("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"
implementation group: 'org.web3j', name: 'core', version: web3jVersion
implementation group: 'org.web3j', name: 'codegen', version: web3jVersion
implementation group: 'org.web3j', name: 'abi', version: web3jVersion
testImplementation 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