1
+ import java.util.Calendar
2
+
1
3
buildscript {
2
4
repositories {
3
5
mavenCentral()
@@ -11,6 +13,7 @@ plugins {
11
13
id(" com.diffplug.spotless" ) apply false
12
14
id(" org.jetbrains.kotlin.jvm" ) apply false
13
15
id(" io.gitlab.arturbosch.detekt" ) apply false
16
+ id(" org.jetbrains.intellij" ) version " 1.8.1"
14
17
}
15
18
16
19
val pluginGroup: String by project
@@ -20,11 +23,54 @@ val pluginSinceBuild: String by project
20
23
val vertxVersion: String by project
21
24
22
25
val platformType: String by project
26
+ val ideVersion: String by project
27
+ val platformPlugins: String by project
23
28
val platformDownloadSources: String by project
24
29
25
30
group = pluginGroup
26
31
version = projectVersion
27
32
33
+ allprojects {
34
+ repositories {
35
+ mavenCentral()
36
+ maven(url = " https://www.jetbrains.com/intellij-repository/releases" ) { name = " intellij-releases" }
37
+ maven(url = " https://cache-redirector.jetbrains.com/intellij-dependencies/" ) { name = " intellij-dependencies" }
38
+ }
39
+
40
+ apply (plugin = " org.jetbrains.intellij" )
41
+
42
+ intellij {
43
+ pluginName.set(" interface-jetbrains" )
44
+ version.set(ideVersion)
45
+ type.set(platformType)
46
+ downloadSources.set(platformDownloadSources.toBoolean())
47
+ updateSinceUntilBuild.set(false )
48
+
49
+ plugins.set(platformPlugins.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty).toMutableList())
50
+ // plugins.add("com.intellij.zh:202.413") //test chinese locale
51
+ }
52
+
53
+ tasks {
54
+ // Disable all Gradle Tasks for the gradle-intellij-plugin as we only use the plugin for the dependencies
55
+ buildPlugin { enabled = false }
56
+ buildSearchableOptions { enabled = false }
57
+ downloadRobotServerPlugin { enabled = false }
58
+ jarSearchableOptions { enabled = false }
59
+ patchPluginXml { enabled = false }
60
+ prepareSandbox { enabled = false }
61
+ prepareTestingSandbox { enabled = false }
62
+ prepareUiTestingSandbox { enabled = false }
63
+ publishPlugin { enabled = false }
64
+ runIde { enabled = false }
65
+ runIdeForUiTests { enabled = false }
66
+ runPluginVerifier { enabled = false }
67
+ signPlugin { enabled = false }
68
+ verifyPlugin { enabled = false }
69
+ listProductsReleases { enabled = false }
70
+ instrumentCode { enabled = false }
71
+ }
72
+ }
73
+
28
74
subprojects {
29
75
repositories {
30
76
mavenCentral()
@@ -74,8 +120,7 @@ subprojects {
74
120
targetCompatibility = " 1.8"
75
121
}
76
122
withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
77
- kotlinOptions.apiVersion = " 1.4"
78
- kotlinOptions.jvmTarget = " 1.8"
123
+ kotlinOptions.jvmTarget = " 11"
79
124
kotlinOptions.freeCompilerArgs + =
80
125
listOf (
81
126
" -Xno-optimized-callable-references" ,
@@ -100,7 +145,7 @@ subprojects {
100
145
targetExclude(" **/generated/**" , " **/liveplugin/**" )
101
146
102
147
val startYear = 2022
103
- val currentYear = java.util. Calendar .getInstance().get(java.util. Calendar .YEAR )
148
+ val currentYear = Calendar .getInstance().get(Calendar .YEAR )
104
149
val copyrightYears = if (startYear == currentYear) {
105
150
" $startYear "
106
151
} else {
@@ -134,4 +179,12 @@ subprojects {
134
179
licenseHeader(formattedLicenseHeader)
135
180
}
136
181
}
182
+
183
+ fun projectDependency (name : String ): ProjectDependency {
184
+ return if (rootProject.name.contains(" jetbrains" )) {
185
+ DependencyHandlerScope .of(rootProject.dependencies).project(name)
186
+ } else {
187
+ DependencyHandlerScope .of(rootProject.dependencies).project(" :interfaces:jetbrains$name " )
188
+ }
189
+ }
137
190
}
0 commit comments