-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
73 lines (58 loc) · 2.3 KB
/
build.gradle.kts
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
/**
* To build the plugin for a particular .properties file, run the following command
*
* ```
* ./gradlew signPlugin -Dconfig=IntelliJ221.properties -DminorVersion=$(git rev-parse --short HEAD)
*
* ```
*
* And check for the .zip plugin in the build/distribution directory.
*
* For development (with debugging enabled), we suggest setting the default config file and using
* the IntelliJ Run Configuration to call `runIde`.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.*
val configFile: String = System.getProperty("config", "IntelliJ223.properties")
val minorVersion: String = System.getProperty("minorVersion", "unversioned")
val config = Properties().apply { load(file("${rootProject.rootDir}/$configFile").inputStream()) }
val kotlinterMinorVersion = 2
val intellijJvmVersion: String = config.getProperty("intellij.jvm.version")
val intellijJavaVersion: JavaVersion = JavaVersion.toVersion(intellijJvmVersion.toInt())
val intellijJvmTarget: JvmTarget = JvmTarget.valueOf("JVM_$intellijJvmVersion")
val intellijIdeVersion: String = config.getProperty("intellij.ide.version")
val intellijMinBuildVersion: String = config.getProperty("intellij.build.min.version")
val intellijMaxBuildVersion: String = config.getProperty("intellij.build.max.version")
plugins {
id("java")
kotlin("jvm") version "2.0.0"
id("org.jetbrains.intellij") version "1.17.4"
}
group = "com.giathuan"
version = "1.$intellijIdeVersion.$minorVersion"
repositories { mavenCentral() }
dependencies { testImplementation(kotlin("test")) }
java { sourceCompatibility = intellijJavaVersion }
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version.set(intellijIdeVersion)
plugins.set(
listOf(
"com.intellij.java",
"org.jetbrains.kotlin",
// "com.google.idea.bazel.ijwb:2023.05.16.0.1-api-version-223",
)
)
}
tasks {
runIde { autoReloadPlugins.set(true) }
buildSearchableOptions { enabled = false }
patchPluginXml {
version.set("${project.version}")
sinceBuild.set(intellijMinBuildVersion)
untilBuild.set(intellijMaxBuildVersion)
}
publishPlugin { token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken")) }
compileKotlin { compilerOptions.jvmTarget.set(intellijJvmTarget) }
compileTestKotlin { compilerOptions.jvmTarget.set(intellijJvmTarget) }
}