forked from SeeSharpSoft/intellij-csv-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
149 lines (131 loc) · 4.2 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
plugins {
// https://github.com/JetBrains/gradle-intellij-plugin
id 'org.jetbrains.intellij' version '1.13.3'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.4'
id 'com.github.ManifestClasspath' version '0.1.0-RELEASE'
// https://github.com/JetBrains/gradle-grammar-kit-plugin
id 'org.jetbrains.grammarkit' version '2021.2.2'
}
jacoco {
toolVersion = "0.8.8"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
group 'net.seesharpsoft.intellij.plugins'
apply plugin: 'java'
project.sourceCompatibility = JavaVersion.VERSION_17
project.targetCompatibility = JavaVersion.VERSION_17
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:deprecation"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'net.seesharpsoft.sharping:sharping-commons:0.21.0'
compileOnly 'org.apache.ant:ant:1.10.13'
testImplementation 'org.mockito:mockito-core:4.8.1'
}
sourceSets {
main {
java {
srcDirs = ['src/main/java', 'gen']
}
resources {
srcDirs = ['src/main/resources']
}
}
test {
java {
srcDirs = ['src/test/java']
}
resources {
srcDirs = ['src/test/resources']
}
}
}
apply plugin: 'idea'
idea {
project {
jdkName = JavaVersion.VERSION_17
languageLevel = JavaVersion.VERSION_17
vcs = 'Git'
}
module {
generatedSourceDirs += file('gen')
}
}
var final EAP_VERSION = 'LATEST-EAP-SNAPSHOT'
var final EAP_BUILD = '231'
var final DEFAULT_VERSION = '2022.2.1' //'LATEST-EAP-SNAPSHOT'
// IDE version - https://www.jetbrains.com/intellij-repository/releases
var idea_version = System.getenv().getOrDefault('IDEA_VERSION', DEFAULT_VERSION)
var build_version = idea_version == EAP_VERSION ? EAP_BUILD : idea_version.substring(2, 4) + idea_version.charAt(5) // extract e.g. '221' from '2022.1.1'
version '3.2.0-' + build_version
apply plugin: 'org.jetbrains.intellij'
intellij {
version = idea_version
type = System.getenv().getOrDefault('IDEA_TYPE', 'IC')
pluginName = 'CSVEditor'
updateSinceUntilBuild = true
sameSinceUntilBuild = true
downloadSources = Boolean.parseBoolean(System.getenv().getOrDefault('IDEA_SOURCES', "true"))
plugins = [
'Git4Idea',
'org.jetbrains.plugins.github'
]
}
patchPluginXml {
// see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description
sinceBuild = build_version
changeNotes = """<pre style="font-family: sans-serif">
FIX: Argument for @NotNull parameter 'tableEditor' of CsvTableActions.adjustColumnWidths must not be null #431
FIX: NullPointerException #429
NEW: prevent error report flooding
FIX: Comment handling breaking in table editor #451
</pre>"""
}
publishPlugin {
token = System.getenv().getOrDefault('JI_TOKEN', '')
channels = [System.getenv().getOrDefault('JI_CHANNELS', 'Testing')]
}
test {
jacoco {
enabled = true
}
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
// see https://youtrack.jetbrains.com/issue/IDEA-278926
scanForTestClasses = false
include "**/*Test.class"
}
grammarKit {
// version of IntelliJ patched JFlex - https://bintray.com/jetbrains/intellij-third-party-dependencies/jflex
jflexRelease = '1.7.0-1'
// tag or short commit hash of Grammar-Kit to use - https://github.com/JetBrains/Grammar-Kit
grammarKitRelease = System.getenv().getOrDefault('GRAMMAR_KIT_VERSION', '2021.1.2')
}
tasks.named("generateParser").configure {
source = 'src/main/java/net/seesharpsoft/intellij/plugins/csv/Csv.bnf'
targetRoot = 'gen'
pathToParser = '/net/seesharpsoft/intellij/plugins/csv/parser/CsvParser.java'
pathToPsiRoot = '/net/seesharpsoft/intellij/plugins/csv/psi'
purgeOldFiles = true
}
tasks.named("generateLexer").configure {
dependsOn generateParser
source = 'src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvLexer.flex'
targetDir = './gen/net/seesharpsoft/intellij/plugins/csv/'
targetClass = 'CsvLexer'
purgeOldFiles = true
}
compileJava {
dependsOn generateLexer
}