-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
177 lines (149 loc) · 4.82 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import org.jetbrains.changelog.Changelog
plugins {
id 'java'
id 'signing'
id 'maven-publish'
id 'org.jetbrains.intellij' version '1.17.1'
id 'org.jetbrains.changelog' version '2.2.0'
id "org.jetbrains.grammarkit" version "2022.3.2.2"
}
Properties versionProps = new Properties()
try (final InputStream stream = new FileInputStream(file('version.properties'))) {
versionProps.load(stream);
}
group = pluginGroup
version = versionProps['pluginVersion']
sourceCompatibility = pluginJavaVersion
targetCompatibility = pluginJavaVersion
// Configure project's dependencies
repositories {
mavenCentral()
}
apply plugin: 'idea'
idea {
module {
generatedSourceDirs += file('src/main/gen')
}
}
// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
apply plugin: 'org.jetbrains.intellij'
intellij {
pluginName = pluginId
type = platformType
version = platformVersion
downloadSources = platformDownloadSources.toBoolean()
updateSinceUntilBuild = true
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = platformPlugins.split(',').collect { it.trim() as String }
}
apply plugin: 'org.jetbrains.changelog'
apply plugin: 'org.jetbrains.grammarkit'
generateLexer {
sourceFile = file("src/main/resources/org/kdb/inside/brains/q.flex")
targetOutputDir = file("src/main/gen/org/kdb/inside/brains")
targetClass = "QLexer"
purgeOldFiles = true
dependsOn("sourcesJar")
}
generateParser {
sourceFile = file("src/main/resources/org/kdb/inside/brains/q.bnf")
targetRootOutputDir = file('src/main/gen')
pathToParser = 'org/kdb/inside/brains/parser/QParser.java'
pathToPsiRoot = 'org/kdb/inside/brains/psi'
purgeOldFiles = true
dependsOn("sourcesJar")
}
dependencies {
implementation 'org.jfree:jfreechart:1.5.4'
implementation 'org.jfree:org.jfree.svg:5.0.5'
implementation 'org.apache.poi:poi:5.2.5'
implementation 'org.apache.poi:poi-ooxml:5.2.5'
testImplementation 'org.mockito:mockito-core:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.2'
}
sourceSets {
main {
java.srcDirs 'src/main/gen', 'src/main/java'
}
}
test {
useJUnitPlatform()
}
tasks.register('generateCode') {
dependsOn generateLexer
dependsOn generateParser
}
compileJava {
dependsOn generateCode
options.compilerArgs += ['-Xlint:unchecked', '-Xlint:deprecation']
}
patchPluginXml {
sinceBuild = pluginSinceBuild
untilBuild = pluginUntilBuild
changeNotes = provider {
changelog.renderItem(changelog.get(project.version).withHeader(false).withEmptySections(false), Changelog.OutputType.HTML)
}
}
runPluginVerifier {
ideVersions = pluginVerifierVersions.split(',').collect { it.trim() as String }
}
publishPlugin {
token = System.getenv("KDBINSIDEBRAINS_RELEASE_PLUGIN_TOKEN")
}
// Release to Maven Central: https://docs.gradle.org/current/userguide/publishing_maven.html
java {
withJavadocJar()
withSourcesJar()
}
sourcesJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
javadoc {
options.addBooleanOption('Xdoclint:none', true)
}
publishing {
repositories {
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'plugin'
from components.java
pom {
name = 'KdbInsideBrains'
description = "Open-Source IntelliJ-based IDEA plugin for <a href=\"https://kx.com/\">kdb+</a> time-series realtime database."
url = 'https://www.kdbinsidebrains.dev'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'kdbinsidebrains'
name = 'Support KdbInsideBrains'
email = 'support@kdbinsidebrains.dev'
}
}
scm {
url = 'https://github.com/kdbinsidebrains/plugin'
connection = 'scm:git:git://github.com/kdbinsidebrains/plugin.git'
developerConnection = 'scm:git:ssh://github.com:kdbinsidebrains/plugin.git'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}