-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
153 lines (119 loc) · 3.91 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
143
144
145
146
147
148
149
150
151
152
153
buildscript {
ext.kotlinx_html_version = "0.7.2"
repositories {
mavenCentral()
}
}
plugins {
id "jacoco"
id "org.jetbrains.intellij" version "0.6.5"
id "org.jetbrains.grammarkit" version "2020.3.1"
id 'org.jetbrains.kotlin.jvm' version '1.4.21'
}
repositories {
mavenCentral()
jcenter()
}
version = pluginVersion
sourceCompatibility = '11'
targetCompatibility = '11'
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
apply plugin: 'antlr'
configurations {
compile {
// remove antlr dependencies from compile scope
extendsFrom = extendsFrom.findAll { it != configurations.antlr }
}
}
dependencies {
compile("org.jetbrains.kotlinx:kotlinx-html-jvm:${kotlinx_html_version}") {
exclude group: "org.jetbrains.kotlin"
}
antlr "org.antlr:antlr4:4.7.1"
compile group: "org.antlr", name: "antlr4-runtime", version: "4.7.1"
testCompile "org.nanohttpd:nanohttpd:2.3.1"
}
sourceSets {
main {
java.srcDirs 'src/main/java', 'gen', 'src/main/kotlin'
}
}
apply plugin: 'org.jetbrains.intellij'
intellij {
version intellij
pluginName 'tezos'
patchPluginXml {
sinceBuild '203.0'
untilBuild '211.*'
}
}
tasks.named("buildSearchableOptions") {
enabled = false
}
publishPlugin {
username 'wallaby'
//add your user's password on the command line using '-Dintellij.publish.password=...'
password System.properties['intellij.publish.password']
channels 'eap'
}
apply plugin: 'org.jetbrains.grammarkit'
import org.jetbrains.grammarkit.tasks.GenerateLexer
import org.jetbrains.grammarkit.tasks.GenerateParser
task generateMichelsonLexer(type: GenerateLexer) {
// source flex file
source = "grammar/_MichelsonLexer.flex"
// target directory for lexer
targetDir = "gen/com/tezos/lang/michelson/parser/"
// target classname, target file will be targetDir/targetClass.java
targetClass = "MichelsonLexer"
// optional, path to the task-specific skeleton file. Default: none
//skeleton = '/some/specific/skeleton'
// if set, plugin will remove a lexer output file before generating new one. Default: false
purgeOldFiles = true
}
task generateMichelsonParser(type: GenerateParser) {
// source bnf file
source = "grammar/michelson.bnf"
// optional, task-specific root for the generated files. Default: none
targetRoot = 'gen'
// path to a parser file, relative to the targetRoot
pathToParser = '/com/tezos/lang/michelson/parser/MichelsonParserGenerated.java'
// path to a directory with generated psi files, relative to the targetRoot
pathToPsiRoot = '/com/tezos/lang/michelson/psi'
// if set, plugin will remove a parser output file and psi output directory before generating new ones. Default: false
purgeOldFiles = true
}
// code coverage using the Jacoco engine, see https://docs.gradle.org/current/userguide/jacoco_plugin.html
// the coverage reports will be available at build/reports/coverage/test/html/index.html
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.6"
// reportsDir = file("$buildDir/reports/coverage")
}
tasks.named("test") {
finalizedBy jacocoTestReport
jacoco {
enabled true
includes["com.tezos.*"]
}
testLogging {
events = [
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED,
org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED,
org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR
]
}
}
// antlr config
generateGrammarSource {
arguments += ["-package", "com.tezos.client.stack", "-visitor"]
}
task generateLexers {
dependsOn generateMichelsonLexer
}
// not working atm due to classpath issues when Gradle is run
task generateParsers {
dependsOn generateMichelsonParser
}
compileKotlin.dependsOn generateGrammarSource