forked from intellij-solidity/intellij-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (110 loc) · 3.16 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
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"
// 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.13.2"
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 = '2022.2.5'
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
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport