-
-
Notifications
You must be signed in to change notification settings - Fork 87
/
build.gradle
148 lines (121 loc) · 3.43 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
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.grammarkit" version "2022.3.1"
id "org.jetbrains.intellij" version "1.17.3"
id 'net.researchgate.release' version '3.0.2'
}
apply plugin: 'java'
apply plugin: 'org.jetbrains.grammarkit'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'idea'
apply plugin: 'jacoco'
def JVM_TARGET = 17
sourceCompatibility = JVM_TARGET
targetCompatibility = JVM_TARGET
compileKotlin {
kotlinOptions.jvmTarget = JVM_TARGET
}
compileTestKotlin {
kotlinOptions.jvmTarget = JVM_TARGET
}
idea {
module {
generatedSourceDirs += file('gen')
}
}
sourceSets {
main {
java.srcDirs += 'gen'
}
}
clean.doFirst {
delete 'gen'
}
intellij {
pluginName = 'Intellij-Solidity'
version = '2023.1'
type = 'IU'
downloadSources = true
updateSinceUntilBuild = false
plugins = ['JavaScript']
sandboxDir = project.rootDir.canonicalPath + "/.sandbox"
}
grammarKit {
// intellijRelease = '2022.2.5'
}
runIde {
maxHeapSize = "1G"
}
repositories {
mavenCentral()
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")
testImplementation group: 'junit', name: 'junit', version: '4.11'
}
release {
newVersionCommitMessage = '[Intellij-Solidity Release] - '
preTagCommitMessage = '[Intellij-Solidity Release] - pre tag commit: '
buildTasks = ['buildPlugin']
git {
requireBranch.set('master')
}
}
tasks.register('codegen') { dependsOn(['generateLexer', 'generateParser']) }
tasks.compileKotlin.dependsOn 'codegen'
generateLexer {
def solLexerName = "_SolidityLexer"
sourceFile = new File("$project.projectDir/src/main/grammars/${solLexerName}.flex")
targetDir = "gen/me/serce/solidity"
targetClass = "$solLexerName"
skeleton = new File('src/main/grammars/idea-flex.skeleton')
purgeOldFiles = true
}
generateParser {
def pkg = 'me/serce/solidity'
sourceFile = new File("$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
// The below configuration fixes the 0% coverage issue, see
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin-faq.html#jacoco-reports-0-coverage
test {
jacoco {
includeNoLocationClasses = true
excludes = ["jdk.internal.*"]
}
}
jacocoTestCoverageVerification {
classDirectories.setFrom(instrumentCode)
}
jacocoTestReport {
classDirectories.setFrom(instrumentCode)
reports {
xml.required = true
html.required = true
}
}
check.dependsOn jacocoTestReport