-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
188 lines (154 loc) · 5.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import io.github.rhdunn.intellij.IntelliJSnapshot
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
buildscript {
ext.ijVersion = BuildConfiguration.INSTANCE.getPlatformVersion(project)
ext.idea_version = ext.ijVersion.platformVersion
ext.idea_since_build = ext.ijVersion.buildVersion
ext.idea_type = ext.ijVersion.platformType ?: BuildConfiguration.INSTANCE.getPlatformType(project)
ext.kotlin_version = Version.INSTANCE.Kotlin(ext.ijVersion)
ext.java_version = Version.INSTANCE.Java(ext.ijVersion)
ext.saxon_version = "9.9.1-7"
ext.jsoup_version = "1.15.4"
ext.junit5_version = "5.9.1"
ext.junit_platform_version = "1.9.1"
ext.plugin_version = "1.9.4"
// Suffix ordering:
// `"-snapshot"` -- for development builds
// `"-eap-###"` -- for early access preview builds (`-eap-1`, `-eap-2`, `-eap-3`, etc.)
// `""` -- for release builds
ext.suffix = ""
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.intellij.platform" version "2.1.0"
}
configure(allprojects - project(":src")) {
apply plugin: "org.jetbrains.intellij.platform"
apply plugin: "idea"
apply plugin: "kotlin"
apply plugin: "jacoco"
group "uk.co.reecedunn.intellij.plugin.xquery"
version = plugin_version + "-" + idea_since_build.toString() + suffix
repositories {
mavenCentral()
mavenLocal()
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
maven { url = "https://packages.jetbrains.team/maven/p/grazi/grazie-platform-public" } // grazie
maven { url = "https://download.jetbrains.com/teamcity-repository" } // teamcity
maven { url = "https://packages.jetbrains.team/maven/p/dpgpv/maven" } // download-pgp-verifier
}
kotlin {
jvmToolchain(java_version)
}
runIde {
maxHeapSize = "2g"
}
dependencies {
intellijPlatform {
if (ijVersion instanceof IntelliJSnapshot) {
create(idea_type, ijVersion.value, false)
jetbrainsRuntime()
} else {
create(idea_type, idea_version, true)
}
instrumentationTools()
testFramework TestFrameworkType.Platform.INSTANCE
}
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5_version")
testImplementation("org.hamcrest:hamcrest-core:1.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junit_platform_version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5_version")
testRuntimeOnly("junit:junit:4.13")
}
// Subproject tasks:
// These tasks fail when run on the subprojects as they do things like looking
// for the plugin.xml file or the idea-sandbox. As such these tasks are disabled
// for the subprojects and only enabled for the main project.
tasks {
buildPlugin.enabled = false
prepareSandbox.enabled = false
publishPlugin.enabled = false
runIde.enabled = false
verifyPlugin.enabled = false
prepareJarSearchableOptions.enabled = false
buildSearchableOptions.enabled = false
}
test {
useJUnitPlatform()
// IntelliJ requires the tests to be run headless when loading icons, etc.
systemProperty("java.awt.headless", "true")
}
}
dependencies {
intellijPlatform {
bundledPlugin("org.intellij.intelliLang")
bundledPlugin("com.intellij.java")
bundledPlugin("com.intellij.properties")
if (idea_since_build >= 243) {
bundledPlugin("com.intellij.modules.json")
}
}
implementation(project(":src:kotlin-intellij"))
implementation(project(":src:lang-core"))
implementation(project(":src:plugin-api"))
implementation(project(":src:plugin-basex"))
implementation(project(":src:plugin-existdb"))
implementation(project(":src:plugin-marklogic"))
implementation(project(":src:plugin-saxon"))
implementation(project(":src:plugin-xijp"))
implementation(project(":src:lang-xdm"))
implementation(project(":src:lang-xpm"))
implementation(project(":src:lang-xpath"))
implementation(project(":src:lang-xquery"))
implementation(project(":src:lang-xslt"))
implementation(project(":src:lang-xproc"))
implementation(project(":src:lang-java"))
implementation(project(":src:lang-xqdoc"))
implementation(project(":src:plugin-expath"))
implementation(project(":src:plugin-exquery"))
implementation(project(":src:plugin-w3"))
testImplementation(project(":src:intellij-test"))
testImplementation("org.hamcrest:hamcrest-core:1.3")
}
if (idea_type == "IU") {
if (idea_since_build >= 193) {
sourceSets.main.resources.srcDirs += "src/main/resources-microservices/193"
} else {
sourceSets.main.resources.srcDirs += "src/main/resources-microservices/compat"
}
} else {
sourceSets.main.resources.srcDirs += "src/main/resources-microservices/compat"
}
// Main project tasks:
// These tasks fail when run on the subprojects as they do things like looking
// for the plugin.xml file or the idea-sandbox. As such these tasks are disabled
// for the subprojects and only enabled for the main project.
tasks {
buildPlugin.enabled = true
prepareSandbox.enabled = true
publishPlugin.enabled = true
runIde.enabled = true
verifyPlugin.enabled = true
prepareJarSearchableOptions.enabled = true
buildSearchableOptions.enabled = true
}
println "Building for IntelliJ ${idea_type} version '${idea_version}', since build '${idea_since_build}'"
intellijPlatform {
pluginConfiguration {
ideaVersion {
sinceBuild = "$idea_since_build"
untilBuild = "$idea_since_build.*"
}
}
}
repositories {
mavenCentral()
}