|
| 1 | +import org.jetbrains.intellij.platform.gradle.TestFrameworkType |
| 2 | + |
1 | 3 | plugins { |
2 | | - id("java") |
3 | | - id("org.jetbrains.kotlin.jvm") version "1.9.24" // https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library |
4 | | - id("org.jetbrains.intellij.platform") version "2.0.1" // https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html |
| 4 | + id("java") // Java support |
| 5 | + alias(libs.plugins.kotlin) // Kotlin support |
| 6 | + alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin |
5 | 7 | } |
6 | 8 |
|
7 | | -group = "com.getyourguide" |
8 | | -version = "1.2.2024.2" |
| 9 | +group = providers.gradleProperty("pluginGroup").get() |
| 10 | +version = providers.gradleProperty("pluginVersion").get() |
9 | 11 |
|
10 | | -val ideaVersion = "2024.2" |
| 12 | +// Set the JVM language level used to build the project. |
| 13 | +kotlin { |
| 14 | + jvmToolchain(21) |
| 15 | +} |
11 | 16 |
|
| 17 | +// Configure project's dependencies |
12 | 18 | repositories { |
13 | 19 | mavenCentral() |
14 | 20 |
|
| 21 | + // IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html |
15 | 22 | intellijPlatform { |
16 | 23 | defaultRepositories() |
17 | 24 | } |
18 | 25 | } |
19 | 26 |
|
| 27 | +// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog |
20 | 28 | dependencies { |
| 29 | + testImplementation(libs.junit) |
| 30 | + |
| 31 | + // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html |
21 | 32 | intellijPlatform { |
22 | | - intellijIdeaCommunity(ideaVersion) |
23 | | - bundledPlugins("org.jetbrains.kotlin", "com.intellij.java", "com.intellij.gradle") |
| 33 | + intellijIdeaUltimate(providers.gradleProperty("platformVersion")) |
| 34 | + |
| 35 | + // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins. |
| 36 | + bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') }) |
| 37 | + |
| 38 | + // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace. |
| 39 | + plugins(providers.gradleProperty("platformPlugins").map { it.split(',') }) |
24 | 40 |
|
25 | 41 | pluginVerifier() |
26 | 42 | zipSigner() |
27 | | - instrumentationTools() |
| 43 | + testFramework(TestFrameworkType.Platform) |
28 | 44 | } |
| 45 | + |
| 46 | + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0") |
29 | 47 | } |
30 | 48 |
|
31 | | -tasks { |
32 | | - runIde { |
33 | | - jvmArgs("-Xmx1g") |
34 | | - } |
35 | | - // Set the JVM compatibility versions |
36 | | - withType<JavaCompile> { |
37 | | - sourceCompatibility = "11" |
38 | | - targetCompatibility = "11" |
| 49 | +// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html |
| 50 | +intellijPlatform { |
| 51 | + pluginConfiguration { |
| 52 | + version = providers.gradleProperty("pluginVersion") |
| 53 | + |
| 54 | + ideaVersion { |
| 55 | + sinceBuild = providers.gradleProperty("pluginSinceBuild") |
| 56 | + untilBuild = providers.gradleProperty("pluginUntilBuild") |
| 57 | + } |
39 | 58 | } |
40 | | - withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { |
41 | | - kotlinOptions.jvmTarget = "11" |
| 59 | + |
| 60 | + pluginVerification { |
| 61 | + ides { |
| 62 | + recommended() |
| 63 | + } |
42 | 64 | } |
| 65 | +} |
43 | 66 |
|
44 | | - patchPluginXml { |
45 | | - sinceBuild.set("241") |
46 | | - untilBuild.set("242.*") |
| 67 | +tasks { |
| 68 | + wrapper { |
| 69 | + gradleVersion = providers.gradleProperty("gradleVersion").get() |
47 | 70 | } |
48 | 71 |
|
49 | | - signPlugin { |
50 | | - certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) |
51 | | - privateKey.set(System.getenv("PRIVATE_KEY")) |
52 | | - password.set(System.getenv("PRIVATE_KEY_PASSWORD")) |
| 72 | + buildSearchableOptions { |
| 73 | + enabled = false |
53 | 74 | } |
| 75 | +} |
| 76 | + |
| 77 | +intellijPlatformTesting { |
| 78 | + runIde { |
| 79 | + register("runIdeForUiTests") { |
| 80 | + task { |
| 81 | + jvmArgumentProviders += CommandLineArgumentProvider { |
| 82 | + listOf( |
| 83 | + "-Drobot-server.port=8082", |
| 84 | + "-Dide.mac.message.dialogs.as.sheets=false", |
| 85 | + "-Djb.privacy.policy.text=<!--999.999-->", |
| 86 | + "-Djb.consents.confirmation.enabled=false", |
| 87 | + ) |
| 88 | + } |
| 89 | + } |
54 | 90 |
|
55 | | - publishPlugin { |
56 | | - token.set(System.getenv("PUBLISH_TOKEN")) |
| 91 | + plugins { |
| 92 | + robotServerPlugin() |
| 93 | + } |
| 94 | + } |
57 | 95 | } |
58 | 96 | } |
0 commit comments